llvm-project
45f7285d - [clang-tidy] Use lexical anon-ns matcher in llvm-prefer-static-over-anonymous-namespace (#148357)

Commit
84 days ago
[clang-tidy] Use lexical anon-ns matcher in llvm-prefer-static-over-anonymous-namespace (#148357) When having this code: ```cpp namespace { class MyClassOutOfAnon { public: MyClassOutOfAnon(); } // namespace MyClassOutOfAnon::MyClassOutOfAnon() {} ``` `MyClassOutOfAnon::MyClassOutOfAnon` is located in anonymous namespace in `DeclContext` but outside anonymous namespace in `LexicalDeclContext`. For this check to work correctly, we need to check if definition is located inside `LexicalDeclContext`.
Author
Parents
Loading