njames93 added inline comments.

================
Comment at: clang-tools-extra/clang-tidy/misc/UseAnonymousNamespaceCheck.cpp:44
+  const SourceManager &SM = MatchedDecl->getASTContext().getSourceManager();
+  if (!SM.isWrittenInMainFile(MatchedDecl->getLocation()))
+    return;
----------------
The logic would fall apart when run in clangd or unity builds. The safest way 
is generally to match the file extension, we have a class for it in 
`clang-tidy/utils`


================
Comment at: 
clang-tools-extra/test/clang-tidy/checkers/misc/use-anonymous-namespace.cpp:51
 struct Foo {
-  static void f();
-  static int x;
----------------
These changes just look like noise.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139113/new/

https://reviews.llvm.org/D139113

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to