[PATCH] D19259: Initial version of misc-unused-using-decl check

Daniel Jasper via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 19 06:15:17 PDT 2016

djasper marked 3 inline comments as done.

Comment at: clang-tidy/misc/MiscTidyModule.cpp:123
@@ -121,1 +122,3 @@
+    CheckFactories.registerCheck<UnusedUsingDeclsCheck>(
+        "misc-unused-using-decls");
alexfh wrote:
> I think, all "misc-unused-" checks except for the "misc-unused-raii" (which finds actual bugs) mostly relate to readability. I suggest placing the new check to readability/ and we'll then move the other two "misc-unused-" checks there as well.
I am not really certain that "readability" is a reasonable category for unused things. Maybe unused should be its own category? At any rate, I think we should move all of them at the same time and not now go ahead and create a weird intermediate state.

Comment at: clang-tidy/misc/UnusedUsingDeclsCheck.cpp:23
@@ +22,3 @@
+  Finder->addMatcher(usingDecl(isExpansionInMainFile()).bind("using"), this);
+  Finder->addMatcher(recordType(hasDeclaration(namedDecl().bind("used"))),
+                     this);
alexfh wrote:
> Why is it necessarily a `recordType`? How about typedefs and enums?
I'd like to handle those as a follow-up. We only track using declarations of Records at the moment in the callback, too.


More information about the cfe-commits mailing list