blob: cb5d10096381a91bcd6e95437fc20c92b10a01b5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
// RUN: %clang_cc1 -ast-print -triple i386-linux-gnu %s -o - -std=c++20 | FileCheck %s
// CHECK: struct DelegatingCtor1 {
struct DelegatingCtor1 {
// CHECK-NEXT: DelegatingCtor1();
DelegatingCtor1();
// CHECK-NEXT: DelegatingCtor1(int) : DelegatingCtor1() {
DelegatingCtor1(int) : DelegatingCtor1() {
// CHECK-NEXT: }
}
// CHECK-NEXT: };
};
// CHECK: struct DelegatingCtor2 {
struct DelegatingCtor2 {
// CHECK-NEXT: template <typename Ty> DelegatingCtor2(Ty);
template <typename Ty> DelegatingCtor2(Ty);
// FIXME: Implicitly specialized method should not be output
// CHECK-NEXT: template<> DelegatingCtor2<float>(float);
// CHECK-NEXT: DelegatingCtor2(int X) : DelegatingCtor2((float)X) {
DelegatingCtor2(int X) : DelegatingCtor2((float)X) {
// CHECK-NEXT: }
}
// CHECK-NEXT: };
};
// CHECK: struct DelegatingCtor3 {
struct DelegatingCtor3 {
// CHECK: DelegatingCtor3(auto);
DelegatingCtor3(auto);
// FIXME: Implicitly specialized method should not be output
// CHECK: template<> DelegatingCtor3<const char *>(const char *);
// CHECK: DelegatingCtor3(int) : DelegatingCtor3("") {
DelegatingCtor3(int) : DelegatingCtor3("") {
// CHECK-NEXT: }
}
// CHECK-NEXT: };
};
// CHECK: struct CurlyCtorInit {
struct CurlyCtorInit {
// CHECK-NEXT: struct A {
struct A {
// CHECK-NEXT: int x;
int x;
// CHECK-NEXT: };
};
// CHECK-NEXT: A a;
A a;
// CHECK-NEXT: int i;
int i;
// FIXME: /*implicit*/(int)0 should not be output
// CHECK-NEXT: CurlyCtorInit(int *) : a(), i(/*implicit*/(int)0) {
CurlyCtorInit(int *) : a(), i() {
// CHECK-NEXT: }
}
// CHECK-NEXT: CurlyCtorInit(int **) : a{}, i{} {
CurlyCtorInit(int **) : a{}, i{} {
// CHECK-NEXT: }
}
// CHECK-NEXT: CurlyCtorInit(int ***) : a({}), i(0) {
CurlyCtorInit(int ***) : a({}), i(0) {
// CHECK-NEXT: }
}
// FIXME: Implicit this should not be output
// CHECK-NEXT: CurlyCtorInit(int ****) : a({.x = 0}), i(this->a.x) {
CurlyCtorInit(int ****) : a({.x = 0}), i(a.x) {
// CHECK-NEXT: }
}
// CHECK-NEXT: };
};
// CHECK: struct DefMethodsWithoutBody {
struct DefMethodsWithoutBody {
// CHECK-NEXT: DefMethodsWithoutBody() = delete;
DefMethodsWithoutBody() = delete;
// CHECK-NEXT: DefMethodsWithoutBody() = default;
~DefMethodsWithoutBody() = default;
// CHECK-NEXT: void m1() __attribute__((alias("X")));
void m1() __attribute__((alias("X")));
// CHECK-NEXT: };
};
// ---- Check that implict (non-written) constructor initializers are not output
struct ImplicitCtorInit1 {
int a;
};
// CHECK: struct ImplicitCtorInit2 : ImplicitCtorInit1 {
struct ImplicitCtorInit2 : ImplicitCtorInit1 {
// CHECK-NEXT: ImplicitCtorInit2(int *) {
ImplicitCtorInit2(int *) {
// CHECK-NEXT: }
}
// CHECK-NEXT: ImplicitCtorInit2(int **) : ImplicitCtorInit1() {
ImplicitCtorInit2(int **) : ImplicitCtorInit1() {
// CHECK-NEXT: }
}
// CHECK-NEXT: };
};
|