[clang-tidy] implement cppcoreguidelines macro rules
authorJonas Toth <jonas.toth@gmail.com>
Mon, 22 Oct 2018 19:20:01 +0000 (19:20 +0000)
committerJonas Toth <jonas.toth@gmail.com>
Mon, 22 Oct 2018 19:20:01 +0000 (19:20 +0000)
commit552b62ed1f24dfbed4b5ee733415572ead5b228e
treef389feaa5b77a8c10caef76cc0c923be21a00d6e
parentc2e58e726525943ffa6eef3392de42dc0a769470
[clang-tidy] implement cppcoreguidelines macro rules

Summary:
In short macros are discouraged by multiple rules (and sometimes reference randomly). [Enum.1], [ES.30], [ES.31]
This check allows only headerguards and empty macros for annotation.

Reviewers: aaron.ballman, hokein

Reviewed By: aaron.ballman

Subscribers: jbcoe, Eugene.Zelenko, klimek, nemanjai, mgorny, xazax.hun, kbarton, cfe-commits

Differential Revision: https://reviews.llvm.org/D41648

llvm-svn: 344940
clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt
clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp
clang-tools-extra/clang-tidy/cppcoreguidelines/MacroUsageCheck.cpp [new file with mode: 0644]
clang-tools-extra/clang-tidy/cppcoreguidelines/MacroUsageCheck.h [new file with mode: 0644]
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-macro-usage.rst [new file with mode: 0644]
clang-tools-extra/docs/clang-tidy/checks/list.rst
clang-tools-extra/test/clang-tidy/cppcoreguidelines-macro-usage-caps-only.cpp [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/cppcoreguidelines-macro-usage-custom.cpp [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/cppcoreguidelines-macro-usage.cpp [new file with mode: 0644]