Create fix-it hints to fix the order of constructors.
To make this a lot simpler, I've grouped all the warnings for each out of order initializer into 1.
This is necessary as fixing one initializer would often interfere with other initializers.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/include/clang/Basic/DiagnosticSemaKinds.td | ||
---|---|---|
8611 ↗ | (On Diff #331582) | 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. |
clang/lib/Sema/SemaDeclCXX.cpp | ||
5242 ↗ | (On Diff #331582) | |
5247 ↗ | (On Diff #331582) | |
5304 ↗ | (On Diff #331582) |
clang/lib/Sema/SemaDeclCXX.cpp | ||
---|---|---|
5242 ↗ | (On Diff #331582) | This was copied from the old impl, Not sure it this is going to change behaviour though. |
Comment Actions
Thanks for this! The changes LGTM, but wait to land it for a day or two in case @rsmith has concerns.
clang/lib/Sema/SemaDeclCXX.cpp | ||
---|---|---|
5242 ↗ | (On Diff #331582) | 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. |