1 | // RUN: clang-pseudo -grammar=cxx -source=%s --print-forest | FileCheck %s |
2 | // FIXME: tighten CHECK to CHECK-NEXT once numeric literals are unambiguous. |
3 | auto x = { 1, .f = 2, [c]{3} }; |
4 | // CHECK: initializer-clause~braced-init-list |
5 | // CHECK-NEXT: ├─{ := tok[3] |
6 | // CHECK-NEXT: ├─initializer-list |
7 | // CHECK-NEXT: │ ├─initializer-list |
8 | // CHECK-NEXT: │ │ ├─initializer-list~NUMERIC_CONSTANT |
9 | // CHECK-NEXT: │ │ ├─, := tok[5] |
10 | // CHECK-NEXT: │ │ └─initializer-list-item |
11 | // CHECK-NEXT: │ │ ├─designator |
12 | // CHECK-NEXT: │ │ │ ├─. := tok[6] |
13 | // CHECK-NEXT: │ │ │ └─IDENTIFIER := tok[7] |
14 | // CHECK-NEXT: │ │ └─brace-or-equal-initializer |
15 | // CHECK-NEXT: │ │ ├─= := tok[8] |
16 | // CHECK-NEXT: │ │ └─initializer-clause~NUMERIC_CONSTANT |
17 | // CHECK-NEXT: │ ├─, := tok[10] |
18 | // CHECK-NEXT: │ └─initializer-list-item |
19 | // CHECK-NEXT: │ ├─designator |
20 | // CHECK-NEXT: │ │ ├─[ := tok[11] |
21 | // CHECK-NEXT: │ │ ├─expression~IDENTIFIER := tok[12] |
22 | // CHECK-NEXT: │ │ └─] := tok[13] |
23 | // CHECK-NEXT: │ └─brace-or-equal-initializer~braced-init-list |
24 | // CHECK-NEXT: │ ├─{ := tok[14] |
25 | // CHECK-NEXT: │ ├─initializer-list~NUMERIC_CONSTANT |
26 | // CHECK: │ └─} := tok[16] |
27 | // CHECK-NEXT: └─} := tok[17] |
28 | |