MTC added inline comments.
================ Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp:49 +void forEachFieldWithFilter(const RecordDecl &Record, const T &Fields, + bool &AnyMemberHasInitPerUnion, Func &&Fn) { + for (const FieldDecl *F : Fields) { ---------------- Can it be modified to the following form? Or further abstract `filter` into a parameter to make this function more general. ``` template <typename T, typename Func> void forEachFieldWithFilter(const RecordDecl &Record, const T &Fields, bool &AnyMemberHasInitPerUnion, Func &&Fn) { forEachField(Record, Fields, Fn); if (Record.isUnion() && AnyMemberHasInitPerUnion) break; } ``` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108370/new/ https://reviews.llvm.org/D108370 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits