[clang-tools-extra] [clang-tidy]fix misc-unused-using-decls false positive false for using in elaborated type (PR #70230)

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 25 11:10:58 PDT 2023


================
@@ -71,6 +72,10 @@ void UnusedUsingDeclsCheck::registerMatchers(MatchFinder *Finder) {
                          templateArgument().bind("used")))),
                      this);
   Finder->addMatcher(userDefinedLiteral().bind("used"), this);
+  Finder->addMatcher(
+      elaboratedType(unless(hasQualifier(nestedNameSpecifier())),
+                     hasUnqualifiedDesugaredType(type().bind("usedType"))),
----------------
PiotrZSL wrote:

```suggestion
      loc(elaboratedType(unless(hasQualifier(nestedNameSpecifier())),
                     hasUnqualifiedDesugaredType(type().bind("usedType")))),
```

To avoid matching too much.

https://github.com/llvm/llvm-project/pull/70230


More information about the cfe-commits mailing list