Issue 58098
Summary `misc-const-correctness.WarnPointersAsValues` not reported
Labels new issue
Assignees
Reporter firewave
    ```cpp
class A
{
public:
    void f(A*);
};

class C {
private:
    void f();
    A *a();
};

void C::f()
{
    A * /*const*/ a1 = a(); // no warning
    A * const a2 = a();
    a1->f(a2);
}
```
https://godbolt.org/z/cWKG6xWEv

If you remove the function call the warning is reported.

CC @JonasToth
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to