[PATCH] D97132: [clang-tidy] Harden PreferMemberInitializerCheck
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 22 08:28:08 PST 2021
aaron.ballman added a comment.
> Fix potential crash if macros are used, Now we just don't try to emit a fix.
Can you add a test case that covers this change?
================
Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.cpp:105
+ return std::make_pair(nullptr, nullptr);
+ const auto *Init = BO->getRHS()->IgnoreParenImpCasts();
+ if (isSafeAssignment(Field, Init, Ctor))
----------------
================
Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.cpp:123
+ return std::make_pair(nullptr, nullptr);
+ const auto *Init = COCE->getArg(1)->IgnoreParenImpCasts();
+ if (isSafeAssignment(Field, Init, Ctor))
----------------
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97132/new/
https://reviews.llvm.org/D97132
More information about the cfe-commits
mailing list