MTC added inline comments.
================
Comment at:
clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp:36
template <typename T, typename Func>
void forEachField(const RecordDecl &Record, const T &Fields, Func &&Fn) {
for (const FieldDecl *F : Fields) {
----------------
Btw, the parameter `Record` seems useless, could you clean it up in another
patch?
================
Comment at:
clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp:439
+ [&](const FieldDecl *F) {
+ if (!HasRecordClasMemberSet.count(F))
+ {
----------------
I believe `DenseSet::contains` is more appropriate here.
================
Comment at:
clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp:454
+
+ if (AllFieldsToInit.empty())
+ return;
----------------
`FieldsToInit` being empty implies `AllFieldsToInit` is empty. We have checked
the emptiness of `FieldsToInit`.
================
Comment at:
clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-pro-type-member-init.cpp:211
// FIXME: The fix-its here collide providing an erroneous fix
int A, B;
----------------
Please update the comments.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107641/new/
https://reviews.llvm.org/D107641
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits