[clang-tools-extra] [clang-tidy]Fix PreferMemberInitializer false positive for reassignment (PR #70316)

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 27 07:15:42 PDT 2023


================
@@ -156,6 +153,49 @@ void PreferMemberInitializerCheck::check(
   const CXXRecordDecl *Class = Ctor->getParent();
   bool FirstToCtorInits = true;
 
+  std::map<const FieldDecl *, AssignedLevel> AssignedFields{};
----------------
PiotrZSL wrote:

Consider something like llvm::SmallDenceMap or llvm::SmallMapVector or something....

https://github.com/llvm/llvm-project/pull/70316


More information about the cfe-commits mailing list