[clang-tidy] Add check misc-multiple-statement-macro
authorSamuel Benzaquen <sbenza@google.com>
Thu, 14 Apr 2016 21:15:57 +0000 (21:15 +0000)
committerSamuel Benzaquen <sbenza@google.com>
Thu, 14 Apr 2016 21:15:57 +0000 (21:15 +0000)
commit4fa2d57c6db8c7c5e017761643606697c050787c
treeb5d64e06f0870cbd790306e8334bec61808321c8
parent1ca263c8903b765349d48490de1bfa7def0dc48d
[clang-tidy] Add check misc-multiple-statement-macro

Summary:
The check detects multi-statement macros that are used in unbraced conditionals.
Only the first statement will be part of the conditionals and the rest will fall
outside of it and executed unconditionally.

Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D18766

llvm-svn: 266369
clang-tools-extra/clang-tidy/misc/CMakeLists.txt
clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp
clang-tools-extra/clang-tidy/misc/MultipleStatementMacroCheck.cpp [new file with mode: 0644]
clang-tools-extra/clang-tidy/misc/MultipleStatementMacroCheck.h [new file with mode: 0644]
clang-tools-extra/docs/clang-tidy/checks/list.rst
clang-tools-extra/docs/clang-tidy/checks/misc-multiple-statement-macro.rst [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/misc-multiple-statement-macro.cpp [new file with mode: 0644]