[PATCH] D55411: [clang-tidy] check for flagging using declarations not in the inner most namespace
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 11 10:27:30 PDT 2019
aaron.ballman added inline comments.
================
Comment at: clang-tidy/abseil/SafelyScopedCheck.cpp:37
+ diag(MatchedDecl->getLocation(),
+ "using declaration %0 not declared in the innermost namespace.")
+ << MatchedDecl;
----------------
You should remove the full stop at the end of the diagnostic.
================
Comment at: test/clang-tidy/abseil-safely-scoped.cpp:15-16
+} // namespace foo1
+// CHECK-MESSAGES: :[[@LINE-5]]:12: warning: using declaration 'A' not
+// declared in the innermost namespace. [abseil-safely-scoped]
+
----------------
This should be moved closer to where the actual warning will show up.
However, the diagnostic doesn't help me to understand what is wrong with the code or how to fix it. I think it might be telling me that the using declaration is supposed to be inside of the anonymous namespace, but moving the using declaration there will break the declaration of `f()`.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55411/new/
https://reviews.llvm.org/D55411
More information about the cfe-commits
mailing list