- Notifications
You must be signed in to change notification settings - Fork 15.3k
Closed
Labels
Description
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.