[PATCH] D41648: [clang-tidy] implement cppcoreguidelines macro rules
Jonas Toth via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 12 07:57:25 PDT 2018
JonasToth added a comment.
Updated
================
Comment at: clang-tidy/cppcoreguidelines/MacroUsageCheck.cpp:78
+ "function-like macro used; consider a 'constexpr' template function";
+ if (Info->isVariadic())
+ DiagnosticMessage = "variadic macro used; consider using a 'constexpr' "
----------------
aaron.ballman wrote:
> Aren't all vararg macros also function-like macros, so this will trigger two diagnostics for all variadic macro definitions?
`MacroInfo` contains bits about function-like and beeing variadic separatly (gnu variadic as well, but thats included in `isVariadic`). There are no double warnings created.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D41648
More information about the cfe-commits
mailing list