[PATCH] D18766: [clang-tidy] Add check misc-multiple-statement-macro

Etienne Bergeron via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 4 13:19:42 PDT 2016


etienneb added a subscriber: etienneb.
etienneb added a comment.

this is cool.


================
Comment at: clang-tidy/misc/MultipleStatementMacroCheck.cpp:33
@@ +32,3 @@
+
+namespace {
+
----------------
I feel it nicer if you merge this namespace with the one at line 20.

================
Comment at: clang-tidy/misc/MultipleStatementMacroCheck.cpp:42
@@ +41,3 @@
+  for (const Stmt *Child : Parent->children()) {
+    if (found)
+      return Child;
----------------
Why not this?

  if (found)
    return Child;
  else
    found = Child == S;    // why the "|" is needed?

================
Comment at: clang-tidy/misc/MultipleStatementMacroCheck.cpp:75
@@ +74,3 @@
+  SourceLocation OuterLoc = Outer->getLocStart();
+  if (Result.Nodes.getNodeAs<Stmt>("else")) {
+    OuterLoc = cast<IfStmt>(Outer)->getElseLoc();
----------------
nit: no { } 


http://reviews.llvm.org/D18766





More information about the cfe-commits mailing list