[PATCH] D41648: [clang-tidy] implement cppcoreguidelines macro rules
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 24 04:37:17 PDT 2018
aaron.ballman added inline comments.
================
Comment at: clang-tidy/cppcoreguidelines/MacroUsageCheck.cpp:77
+ DiagnosticMessage =
+ "function like macro used; consider a (constexpr) template function";
+ if (Info->isVariadic())
----------------
function like -> function-like
Why is constexpr in parentheses?
================
Comment at: clang-tidy/cppcoreguidelines/MacroUsageCheck.cpp:80
+ DiagnosticMessage =
+ "variadic macro used; consider using a variadic template";
+
----------------
Should this also suggest a constexpr variadic template?
================
Comment at: clang-tidy/cppcoreguidelines/MacroUsageCheck.cpp:86
+void MacroUsageCheck::warnNaming(const MacroDirective *MD) {
+ diag(MD->getLocation(), "use CAPS_ONLY for macros");
+}
----------------
How about: `macro definition does not define the macro name using all uppercase characters` or something along those lines?
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D41648
More information about the cfe-commits
mailing list