njames93 added inline comments. Herald added a subscriber: shchenz.
================ Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.cpp:184 + bool AddComma = false; + if (!Ctor->getNumCtorInitializers() && FirstToCtorInits) { + SourceLocation BodyPos = Ctor->getBody()->getBeginLoc(); ---------------- Rechi wrote: > The following example generates invalid fixes, if > modernize-use-default-member-init check isn't enabled, because > `Ctor->getNumCtorInitializers()` returns 1. > > ```lang=cpp > class Example > { > public: > Example() { a = 0; }; > int a; > std::string string; > }; > ``` I've done a little work trying to fix some issues I've noticed while running this check in the wild. I have a feeling this shortcoming has been addressed in there - D97132. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71199/new/ https://reviews.llvm.org/D71199 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits