|
1 | 1 | // RUN: %clang_cc1 -ast-print %s -o - -std=c++20 | FileCheck %s
|
2 | 2 |
|
3 |
| -// CHECK: struct A { |
4 |
| -struct A { |
5 |
| - // CHECK-NEXT: A(); |
6 |
| - A(); |
| 3 | +// CHECK: struct DelegatingCtor1 { |
| 4 | +struct DelegatingCtor1 { |
| 5 | + // CHECK-NEXT: DelegatingCtor1(); |
| 6 | + DelegatingCtor1(); |
7 | 7 |
|
8 |
| - // CHECK-NEXT: A(int) : A() { |
9 |
| - A(int) : A() { |
| 8 | + // CHECK-NEXT: DelegatingCtor1(int) : DelegatingCtor1() { |
| 9 | + DelegatingCtor1(int) : DelegatingCtor1() { |
10 | 10 | // CHECK-NEXT: }
|
11 | 11 | }
|
12 | 12 |
|
13 | 13 | // CHECK-NEXT: };
|
14 | 14 | };
|
15 | 15 |
|
16 | 16 |
|
17 |
| -// CHECK: struct B { |
18 |
| -struct B { |
19 |
| - // CHECK-NEXT: template <typename Ty> B(Ty); |
20 |
| - template <typename Ty> B(Ty); |
| 17 | +// CHECK: struct DelegatingCtor2 { |
| 18 | +struct DelegatingCtor2 { |
| 19 | + // CHECK-NEXT: template <typename Ty> DelegatingCtor2(Ty); |
| 20 | + template <typename Ty> DelegatingCtor2(Ty); |
21 | 21 |
|
22 | 22 | // FIXME: Implicitly specialized method should not be output
|
23 |
| - // CHECK-NEXT: template<> B<float>(float); |
| 23 | + // CHECK-NEXT: template<> DelegatingCtor2<float>(float); |
24 | 24 |
|
25 |
| - // CHECK-NEXT: B(int X) : B((float)X) { |
26 |
| - B(int X) : B((float)X) { |
| 25 | + // CHECK-NEXT: DelegatingCtor2(int X) : DelegatingCtor2((float)X) { |
| 26 | + DelegatingCtor2(int X) : DelegatingCtor2((float)X) { |
27 | 27 | // CHECK-NEXT: }
|
28 | 28 | }
|
29 | 29 |
|
30 | 30 | // CHECK-NEXT: };
|
31 | 31 | };
|
32 | 32 |
|
33 |
| -// CHECK: struct C { |
34 |
| -struct C { |
| 33 | +// CHECK: struct DelegatingCtor3 { |
| 34 | +struct DelegatingCtor3 { |
35 | 35 | // FIXME: template <> should not be output
|
36 |
| - // CHECK: template <> C(auto); |
37 |
| - C(auto); |
| 36 | + // CHECK: template <> DelegatingCtor3(auto); |
| 37 | + DelegatingCtor3(auto); |
38 | 38 |
|
39 | 39 | // FIXME: Implicitly specialized method should not be output
|
40 |
| - // CHECK: template<> C<const char *>(const char *); |
| 40 | + // CHECK: template<> DelegatingCtor3<const char *>(const char *); |
41 | 41 |
|
42 |
| - // CHECK: C(int) : C("") { |
43 |
| - C(int) : C("") { |
| 42 | + // CHECK: DelegatingCtor3(int) : DelegatingCtor3("") { |
| 43 | + DelegatingCtor3(int) : DelegatingCtor3("") { |
| 44 | + // CHECK-NEXT: } |
| 45 | + } |
| 46 | + |
| 47 | + // CHECK-NEXT: }; |
| 48 | +}; |
| 49 | + |
| 50 | +// CHECK: struct CurlyCtorInit { |
| 51 | +struct CurlyCtorInit { |
| 52 | + // CHECK-NEXT: struct A { |
| 53 | + struct A { |
| 54 | + // CHECK-NEXT: int x; |
| 55 | + int x; |
| 56 | + // CHECK-NEXT: }; |
| 57 | + }; |
| 58 | + |
| 59 | + // CHECK-NEXT: A a; |
| 60 | + A a; |
| 61 | + // CHECK-NEXT: int i; |
| 62 | + int i; |
| 63 | + |
| 64 | + // FIXME: /*implicit*/(int)0 should not be output |
| 65 | + // CHECK-NEXT: CurlyCtorInit(int *) : a(), i(/*implicit*/(int)0) { |
| 66 | + CurlyCtorInit(int *) : a(), i() { |
| 67 | + // CHECK-NEXT: } |
| 68 | + } |
| 69 | + |
| 70 | + // CHECK-NEXT: CurlyCtorInit(int **) : a{}, i{} { |
| 71 | + CurlyCtorInit(int **) : a{}, i{} { |
| 72 | + // CHECK-NEXT: } |
| 73 | + } |
| 74 | + |
| 75 | + // CHECK-NEXT: CurlyCtorInit(int ***) : a({}), i(0) { |
| 76 | + CurlyCtorInit(int ***) : a({}), i(0) { |
| 77 | + // CHECK-NEXT: } |
| 78 | + } |
| 79 | + |
| 80 | + // FIXME: Implicit this should not be output |
| 81 | + // CHECK-NEXT: CurlyCtorInit(int ****) : a({.x = 0}), i(this->a.x) { |
| 82 | + CurlyCtorInit(int ****) : a({.x = 0}), i(a.x) { |
44 | 83 | // CHECK-NEXT: }
|
45 | 84 | }
|
46 | 85 |
|
|
0 commit comments