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

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 7 09:15:14 PDT 2016


alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.

LG with a nit.


================
Comment at: clang-tidy/misc/MultipleStatementMacroCheck.cpp:99
@@ +98,3 @@
+
+  diag(InnerRanges.back().first, "multiple statement macro spans unbraced "
+                                 "conditional and the following statement");
----------------
If I saw this message from a tool, I wouldn't get what it means right away. Can you come up with an easier to read alternative? I can only suggest `multiple statement macro used without braces`, but maybe a more self-documenting message comes to your mind.

================
Comment at: docs/clang-tidy/checks/misc-multiple-statement-macro.rst:16
@@ +15,2 @@
+    INCREMENT_TWO(a, b);
+
----------------
While I see your point, this doesn't seem worse to me:

    if (do_increment)
      INCREMENT_TWO(a, b); // `(b)++;` will always be executed.

Up to you though.


http://reviews.llvm.org/D18766





More information about the cfe-commits mailing list