[PATCH] D19259: Initial version of misc-unused-using-decl check
Alexander Kornienko via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 19 06:48:47 PDT 2016
alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.
LG with one nit.
Thank you!
================
Comment at: clang-tidy/misc/MiscTidyModule.cpp:123
@@ -121,1 +122,3 @@
+ CheckFactories.registerCheck<UnusedUsingDeclsCheck>(
+ "misc-unused-using-decls");
CheckFactories.registerCheck<VirtualNearMissCheck>(
----------------
Fair enough. Let's go this way then.
================
Comment at: clang-tidy/misc/UnusedUsingDeclsCheck.cpp:67
@@ +66,3 @@
+ << FixItHint::CreateRemoval(FoundRanges[FoundDecl.first]);
+ }
+}
----------------
`FoundDecls` should be cleared at the end. There are some cases when a check can be used multiple times (e.g. in unit tests). Though we're not adding unit tests here, I think, we shouldn't hide this kind of a surprise in the code ;)
http://reviews.llvm.org/D19259
More information about the cfe-commits
mailing list