You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Minimal example of member access via pointer-to-member via pointer-to-object causing false positive:
struct S { int i; };
void a(int &) {}
int main()
{
S s;
S * sp = &s;
a(sp->*(&S::i));
}
<source>:8:3: warning: pointee of variable 'sp' of type 'S *' can be declared 'const' [misc-const-correctness]
8 | S * sp = &s;
| ^
| const
1 warning generated.
Applying the suggested fix-it would cause a compilation error.
$ clang-tidy --version
LLVM (http://llvm.org/):
LLVM version 21.1.2
Optimized build.