[PATCH] D118927: [clang-tidy] Fix invalid fix-it for cppcoreguidelines-prefer-member-initializer
Richard via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 4 10:13:25 PST 2022
LegalizeAdulthood added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.cpp:251
+ if (InsertPos.isValid())
+ InvalidFix |= InsertPos.isMacroID();
+ else
----------------
I'm not a fan of using bit-wise operators on booleans, but I see that
the code for this check was already doing that.
(See https://github.com/llvm/llvm-project/issues/40307)
================
Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.cpp:293
<< Field;
if (!InvalidFix) {
+ StringRef NewInit = Lexer::getSourceText(
----------------
I'm not a fan of double negatives either `:)`
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118927/new/
https://reviews.llvm.org/D118927
More information about the cfe-commits
mailing list