[PATCH] D132461: [clang-tidy] Add cppcoreguidelines-avoid-do-while check

Carlos Galvez via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 25 23:22:10 PDT 2022


carlosgalvezp added a comment.

In D132461#3748818 <https://reviews.llvm.org/D132461#3748818>, @carlosgalvezp wrote:

> In D132461#3748812 <https://reviews.llvm.org/D132461#3748812>, @njames93 wrote:
>
>> The AllowWhileFlase option seems the wrong way to go about silencing do while(false) macros. Would it not make more sense to just ignore macros, or if you want more specificty don't warn on macros with a false condition?
>
> Strictly speaking, the C++ Core Guidelines do not make any such exception for macros. That's why I thought an option would allow both users who want to comply strictly, and users who want a bit more flexibility (without having to `NOLINT` their way out of it). Similar options exist for other C++ Core Guidelines checks.

Or do you mean renaming the `AllowWhileFalse` option to `IgnoreMacros` and make the exception broader? I'd be fine with that as well, I'm not particularly happy with the `AllowWhileFalse` name :)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132461/new/

https://reviews.llvm.org/D132461



More information about the cfe-commits mailing list