[PATCH] D25024: [clang-tidy] Add check for detecting declarations with multiple names

Kirill Bobyrev via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 28 12:46:02 PDT 2016


omtcyfz added inline comments.

================
Comment at: clang-tidy/cppcoreguidelines/OneNamePerDeclarationCheck.cpp:26
@@ +25,3 @@
+
+} // end anonymous namespace
+
----------------
Eugene.Zelenko wrote:
> Namespace is inconsistent with following ones. It I'm not mistaken, **// namespace** is prevailing form in CLang-tidy code.
You're right. That's interesting though, because LLVM Coding Guidelines suggest `end namespace mah_name`.

================
Comment at: clang-tidy/cppcoreguidelines/OneNamePerDeclarationCheck.cpp:30
@@ +29,3 @@
+  Finder->addMatcher(
+      declStmt(declCountIsGreaterThan(1)).bind("multipleNameDeclaration"),
+      this);
----------------
malcolm.parsons wrote:
> Can declCountIsGreaterThan(1) be written as unless(declCountIs(1))?
Sure it can. I just thought `declCountIsGreaterThan` might be useful at some point.


https://reviews.llvm.org/D25024





More information about the cfe-commits mailing list