[PATCH] D98745: [clang] Add fixit for Wreorder-ctor

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 18 10:03:08 PDT 2021


aaron.ballman added inline comments.


================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:8611
+def warn_some_initializers_out_of_order : Warning<
+  "some initializers aren't given in the correct order">,
+  InGroup<ReorderCtor>, DefaultIgnore;
----------------
Hmmm, how about `initializer order does not match the declaration order` or something along those lines? The "some" and "in the correct order" feel a bit hand-wavy for a warning.


================
Comment at: clang/lib/Sema/SemaDeclCXX.cpp:5242
+  if (Previous->isAnyMemberInitializer())
+    Diag << 0 << Previous->getAnyMember()->getDeclName();
+  else
----------------



================
Comment at: clang/lib/Sema/SemaDeclCXX.cpp:5247
+  if (Current->isAnyMemberInitializer())
+    Diag << 0 << Current->getAnyMember()->getDeclName();
+  else
----------------



================
Comment at: clang/lib/Sema/SemaDeclCXX.cpp:5304
+  SmallVector<unsigned> WarnIndexes;
+  // Correllates the index of an initializer in the init-list to the index of
+  // the field/base in the class.
----------------



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98745/new/

https://reviews.llvm.org/D98745



More information about the cfe-commits mailing list