[PATCH] D116386: [clang-tidy] Narrow cppguidelines-macro-usage to actual constants

Richard via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 19 08:00:55 PST 2022

LegalizeAdulthood marked 2 inline comments as done.
LegalizeAdulthood added inline comments.

Comment at: clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-macro-usage.rst:11
+`ES.31 <https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es31-dont-use-macros-for-constants-or-functions>`_, and
+`ES.32 <https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es32-use-all_caps-for-all-macro-names>`_.
carlosgalvezp wrote:
> Is ES.32 really checked by this check? I don't see any example or test that indicates that.
> I'm also unsure if ES.32 should be handled here or via the "readability-identifier-naming" check, which is where you enforce a particular naming convention for different identifiers. Setting ALL_CAPS for macros there would be an effective way of solving ES.32.
It was always handled through an option on this check.
(Look at lines 49-56 of `MacroUsageCheck.cpp`)

It's a little bit odd, because it either checks for the names
or it checks for the constant/function like macros, it never
does both at the same time.

This is the way the check was originally written, I haven't
changed any of that.



More information about the cfe-commits mailing list