Issue 90955
Summary AST dump doesn't capture names of fields in designated initializers
Labels c++20, clang:frontend
Assignees
Reporter Endilll
    Consider the following example from [dcl.init.aggr] (https://godbolt.org/z/GahTznz4q):
```cpp
struct C {
  union {
 int a;
    const char* p;
  };
  int x;
} c = { .a = 1, .x = 3};
```
AST dump for `c` is the following:
```
`-VarDecl <line:2:1, line:8:23> col:3 c 'struct C':'C' cinit
  `-InitListExpr <col:7, col:23> 'struct C':'C'
    |-InitListExpr <col:9, col:14> 'C::(anonymous union at line:3:3)' field Field 0xeb0b660 'a' 'int'
    | `-IntegerLiteral <col:14> 'int' 1
    `-IntegerLiteral <col:22> 'int' 3
```
Note that the dump captures the fact that `1` is used to initialize anonymous union member `a`, but doesn't capture that 3 is used to initialize `C::x`.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to