Use member's type when printing.
This also fixes a bug in warning diagnostic for out of order
initialization with designated initializers so it points to a valid
source location when an anonymous member is being initialized.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thank you for this fix, it is a lot cleaner than I was expecting.
clang/include/clang/AST/Decl.h | ||
---|---|---|
3186 | So it looks like w/o this we would end up using NamedDecl::printName(...) is that right? | |
clang/test/AST/ast-dump-APValue-anon-union.cpp | ||
43 | I am curious what the rest of the diagnostic message from anonymous union at... says. |
LGTM aside from a small nit
clang/lib/AST/Decl.cpp | ||
---|---|---|
4567–4569 | This way we're not reimplementing the same logic that NamedDecl does (in case we update that logic at some point in the future). |
So it looks like w/o this we would end up using NamedDecl::printName(...) is that right?