[clang-tools-extra] [clang-tidy] Update llvmlibc-implementation-in-namespace to new rules (PR #66504)

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 21 06:29:05 PDT 2023


================
@@ -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


More information about the cfe-commits mailing list