[PATCH] Add check misc-braces-around-statements.

Marek Kurdej curdeius at gmail.com
Mon Sep 22 07:30:25 PDT 2014


Alex, thanks for the useful comments.
The code is much cleaner now.
Besides, trying to apply your suggestions, I stumbled upon one more case where previous implementation gave erroneous results, namely when there are comments or whitespace, or empty macro expansion inside the if/while condition.
I have therefore added a function `backwardSkipWhitespacesAndComments` (actually copied from `clang-modernize/AddOverride/AddOverrideActions.cpp` - maybe some refactoring is needed to pull up common utilities?).

================
Comment at: clang-tidy/misc/BracesAroundStatementsCheck.h:33
@@ +32,2 @@
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_BRACES_AROUND_STATEMENTS_CHECK_H
----------------
This line does not hold the 80-column limit, but clang-format leaves it as it is.
What is the convention in this case?

http://reviews.llvm.org/D5395






More information about the cfe-commits mailing list