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

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 18 11:26:00 PDT 2021


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

Thanks for this! The changes LGTM, but wait to land it for a day or two in case @rsmith has concerns.



================
Comment at: clang/lib/Sema/SemaDeclCXX.cpp:5242
+  if (Previous->isAnyMemberInitializer())
+    Diag << 0 << Previous->getAnyMember()->getDeclName();
+  else
----------------
njames93 wrote:
> aaron.ballman wrote:
> > 
> This was copied from the old impl, Not sure it this is going to change behaviour though.
> No tests needed to be updated though,
The diagnostic engine knows how to format anything that's a `NamedDecl` (including quoting it properly, etc), but it does the same work for `DeclarationName`. There shouldn't be a change in behavior in this case, just a slight simplification of code.


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