[PATCH] D20429: [clang-tidy] Handle using-decls with more than one shadow decl.

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Thu May 19 07:32:21 PDT 2016

hokein marked an inline comment as done.

Comment at: clang-tidy/misc/UnusedUsingDeclsCheck.cpp:22
@@ +21,3 @@
+namespace {
+bool IsValidDecl(const Decl *TargetDecl) {
+  // Ignores using-declarations defined in macros.
alexfh wrote:
> This method assumes a rather non-trivial definition of "valid". Please add a comment what exactly this method does.
> Also, static is preferred to anonymous namespaces for functions in LLVM style (http://llvm.org/docs/CodingStandards.html#anonymous-namespaces):
> | ... make anonymous namespaces as small as possible, and only use them for class declarations. ...
I have renamed to `IsCheckable`, but it doesn't make more sense here. Do you have better suggestion on the function name? 

Comment at: test/clang-tidy/misc-unused-using-decls.cpp:86
@@ +85,3 @@
+// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: using decl 'OverloadFunc' is unused
+// CHECK-FIXES: {{^}}// OverloadFunc
Will do it in a follow-up.


More information about the cfe-commits mailing list