================
@@ -18,32 +18,32 @@ const static StringRef RequiredNamespaceStart = 
"__llvm_libc";
 const static StringRef RequiredNamespaceMacroName = "LIBC_NAMESPACE";
 
 void ImplementationInNamespaceCheck::registerMatchers(MatchFinder *Finder) {
-  Finder->addMatcher(
-      decl(hasParent(translationUnitDecl()), unless(linkageSpecDecl()))
-          .bind("child_of_translation_unit"),
-      this);
+  Finder->addMatcher(decl(isExpansionInMainFile(),
----------------
PiotrZSL wrote:

On a hand, we could try oposite:
```
  Finder->addMatcher(translationUnitDecl(forEach(decl(isExpansionInMainFile(),
                          unless(linkageSpecDecl()))
                         .bind("child_of_translation_unit"))),
                     this);
```

https://github.com/llvm/llvm-project/pull/66504
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to