11// RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s
22
3- static_assert (!__builtin_lt_synthesises_from_spaceship ()); // expected-error {{expected a type}}
4- static_assert (!__builtin_lt_synthesises_from_spaceship (int )); // expected-error {{type trait requires 2 arguments; have 1 argument}}
5- static_assert (!__builtin_lt_synthesises_from_spaceship (int , int , int )); // expected-error {{type trait requires 2 arguments; have 3 argument}}
6- static_assert (!__builtin_lt_synthesises_from_spaceship (int , 0 )); // expected-error {{expected a type}}
7-
8- static_assert (!__builtin_le_synthesises_from_spaceship ()); // expected-error {{expected a type}}
9- static_assert (!__builtin_le_synthesises_from_spaceship (int )); // expected-error {{type trait requires 2 arguments; have 1 argument}}
10- static_assert (!__builtin_le_synthesises_from_spaceship (int , int , int )); // expected-error {{type trait requires 2 arguments; have 3 argument}}
11- static_assert (!__builtin_le_synthesises_from_spaceship (int , 0 )); // expected-error {{expected a type}}
12-
13- static_assert (!__builtin_gt_synthesises_from_spaceship ()); // expected-error {{expected a type}}
14- static_assert (!__builtin_gt_synthesises_from_spaceship (int )); // expected-error {{type trait requires 2 arguments; have 1 argument}}
15- static_assert (!__builtin_gt_synthesises_from_spaceship (int , int , int )); // expected-error {{type trait requires 2 arguments; have 3 argument}}
16- static_assert (!__builtin_gt_synthesises_from_spaceship (int , 0 )); // expected-error {{expected a type}}
17-
18- static_assert (!__builtin_ge_synthesises_from_spaceship ()); // expected-error {{expected a type}}
19- static_assert (!__builtin_ge_synthesises_from_spaceship (int )); // expected-error {{type trait requires 2 arguments; have 1 argument}}
20- static_assert (!__builtin_ge_synthesises_from_spaceship (int , int , int )); // expected-error {{type trait requires 2 arguments; have 3 argument}}
21- static_assert (!__builtin_ge_synthesises_from_spaceship (int , 0 )); // expected-error {{expected a type}}
3+ static_assert (!__builtin_lt_synthesizes_from_spaceship ()); // expected-error {{expected a type}}
4+ static_assert (!__builtin_lt_synthesizes_from_spaceship (int )); // expected-error {{type trait requires 2 arguments; have 1 argument}}
5+ static_assert (!__builtin_lt_synthesizes_from_spaceship (int , int , int )); // expected-error {{type trait requires 2 arguments; have 3 argument}}
6+ static_assert (!__builtin_lt_synthesizes_from_spaceship (int , 0 )); // expected-error {{expected a type}}
7+
8+ static_assert (!__builtin_le_synthesizes_from_spaceship ()); // expected-error {{expected a type}}
9+ static_assert (!__builtin_le_synthesizes_from_spaceship (int )); // expected-error {{type trait requires 2 arguments; have 1 argument}}
10+ static_assert (!__builtin_le_synthesizes_from_spaceship (int , int , int )); // expected-error {{type trait requires 2 arguments; have 3 argument}}
11+ static_assert (!__builtin_le_synthesizes_from_spaceship (int , 0 )); // expected-error {{expected a type}}
12+
13+ static_assert (!__builtin_gt_synthesizes_from_spaceship ()); // expected-error {{expected a type}}
14+ static_assert (!__builtin_gt_synthesizes_from_spaceship (int )); // expected-error {{type trait requires 2 arguments; have 1 argument}}
15+ static_assert (!__builtin_gt_synthesizes_from_spaceship (int , int , int )); // expected-error {{type trait requires 2 arguments; have 3 argument}}
16+ static_assert (!__builtin_gt_synthesizes_from_spaceship (int , 0 )); // expected-error {{expected a type}}
17+
18+ static_assert (!__builtin_ge_synthesizes_from_spaceship ()); // expected-error {{expected a type}}
19+ static_assert (!__builtin_ge_synthesizes_from_spaceship (int )); // expected-error {{type trait requires 2 arguments; have 1 argument}}
20+ static_assert (!__builtin_ge_synthesizes_from_spaceship (int , int , int )); // expected-error {{type trait requires 2 arguments; have 3 argument}}
21+ static_assert (!__builtin_ge_synthesizes_from_spaceship (int , 0 )); // expected-error {{expected a type}}
2222
2323namespace std {
2424 struct strong_ordering {
@@ -35,10 +35,10 @@ struct DefaultSpaceship {
3535 friend auto operator <=>(DefaultSpaceship, DefaultSpaceship) = default ;
3636};
3737
38- static_assert (__builtin_lt_synthesises_from_spaceship (const DefaultSpaceship&, const DefaultSpaceship&));
39- static_assert (__builtin_le_synthesises_from_spaceship (const DefaultSpaceship&, const DefaultSpaceship&));
40- static_assert (__builtin_gt_synthesises_from_spaceship (const DefaultSpaceship&, const DefaultSpaceship&));
41- static_assert (__builtin_ge_synthesises_from_spaceship (const DefaultSpaceship&, const DefaultSpaceship&));
38+ static_assert (__builtin_lt_synthesizes_from_spaceship (const DefaultSpaceship&, const DefaultSpaceship&));
39+ static_assert (__builtin_le_synthesizes_from_spaceship (const DefaultSpaceship&, const DefaultSpaceship&));
40+ static_assert (__builtin_gt_synthesizes_from_spaceship (const DefaultSpaceship&, const DefaultSpaceship&));
41+ static_assert (__builtin_ge_synthesizes_from_spaceship (const DefaultSpaceship&, const DefaultSpaceship&));
4242
4343struct CustomSpaceship {
4444 int i;
@@ -48,10 +48,10 @@ struct CustomSpaceship {
4848 }
4949};
5050
51- static_assert (__builtin_lt_synthesises_from_spaceship (const CustomSpaceship&, const CustomSpaceship&));
52- static_assert (__builtin_le_synthesises_from_spaceship (const CustomSpaceship&, const CustomSpaceship&));
53- static_assert (__builtin_gt_synthesises_from_spaceship (const CustomSpaceship&, const CustomSpaceship&));
54- static_assert (__builtin_ge_synthesises_from_spaceship (const CustomSpaceship&, const CustomSpaceship&));
51+ static_assert (__builtin_lt_synthesizes_from_spaceship (const CustomSpaceship&, const CustomSpaceship&));
52+ static_assert (__builtin_le_synthesizes_from_spaceship (const CustomSpaceship&, const CustomSpaceship&));
53+ static_assert (__builtin_gt_synthesizes_from_spaceship (const CustomSpaceship&, const CustomSpaceship&));
54+ static_assert (__builtin_ge_synthesizes_from_spaceship (const CustomSpaceship&, const CustomSpaceship&));
5555
5656struct CustomLT {
5757 int i;
@@ -61,10 +61,10 @@ struct CustomLT {
6161 }
6262};
6363
64- static_assert (!__builtin_lt_synthesises_from_spaceship (const CustomLT&, const CustomLT&));
65- static_assert (!__builtin_le_synthesises_from_spaceship (const CustomLT&, const CustomLT&));
66- static_assert (!__builtin_gt_synthesises_from_spaceship (const CustomLT&, const CustomLT&));
67- static_assert (!__builtin_ge_synthesises_from_spaceship (const CustomLT&, const CustomLT&));
64+ static_assert (!__builtin_lt_synthesizes_from_spaceship (const CustomLT&, const CustomLT&));
65+ static_assert (!__builtin_le_synthesizes_from_spaceship (const CustomLT&, const CustomLT&));
66+ static_assert (!__builtin_gt_synthesizes_from_spaceship (const CustomLT&, const CustomLT&));
67+ static_assert (!__builtin_ge_synthesizes_from_spaceship (const CustomLT&, const CustomLT&));
6868
6969struct CustomLE {
7070 int i;
@@ -74,10 +74,10 @@ struct CustomLE {
7474 }
7575};
7676
77- static_assert (!__builtin_lt_synthesises_from_spaceship (const CustomLE&, const CustomLE&));
78- static_assert (!__builtin_le_synthesises_from_spaceship (const CustomLE&, const CustomLE&));
79- static_assert (!__builtin_gt_synthesises_from_spaceship (const CustomLE&, const CustomLE&));
80- static_assert (!__builtin_ge_synthesises_from_spaceship (const CustomLE&, const CustomLE&));
77+ static_assert (!__builtin_lt_synthesizes_from_spaceship (const CustomLE&, const CustomLE&));
78+ static_assert (!__builtin_le_synthesizes_from_spaceship (const CustomLE&, const CustomLE&));
79+ static_assert (!__builtin_gt_synthesizes_from_spaceship (const CustomLE&, const CustomLE&));
80+ static_assert (!__builtin_ge_synthesizes_from_spaceship (const CustomLE&, const CustomLE&));
8181
8282struct CustomGT {
8383 int i;
@@ -87,10 +87,10 @@ struct CustomGT {
8787 }
8888};
8989
90- static_assert (!__builtin_lt_synthesises_from_spaceship (const CustomGT&, const CustomGT&));
91- static_assert (!__builtin_le_synthesises_from_spaceship (const CustomGT&, const CustomGT&));
92- static_assert (!__builtin_gt_synthesises_from_spaceship (const CustomGT&, const CustomGT&));
93- static_assert (!__builtin_ge_synthesises_from_spaceship (const CustomGT&, const CustomGT&));
90+ static_assert (!__builtin_lt_synthesizes_from_spaceship (const CustomGT&, const CustomGT&));
91+ static_assert (!__builtin_le_synthesizes_from_spaceship (const CustomGT&, const CustomGT&));
92+ static_assert (!__builtin_gt_synthesizes_from_spaceship (const CustomGT&, const CustomGT&));
93+ static_assert (!__builtin_ge_synthesizes_from_spaceship (const CustomGT&, const CustomGT&));
9494
9595struct CustomGE {
9696 int i;
@@ -100,10 +100,10 @@ struct CustomGE {
100100 }
101101};
102102
103- static_assert (!__builtin_lt_synthesises_from_spaceship (const CustomGE&, const CustomGE&));
104- static_assert (!__builtin_le_synthesises_from_spaceship (const CustomGE&, const CustomGE&));
105- static_assert (!__builtin_gt_synthesises_from_spaceship (const CustomGE&, const CustomGE&));
106- static_assert (!__builtin_ge_synthesises_from_spaceship (const CustomGE&, const CustomGE&));
103+ static_assert (!__builtin_lt_synthesizes_from_spaceship (const CustomGE&, const CustomGE&));
104+ static_assert (!__builtin_le_synthesizes_from_spaceship (const CustomGE&, const CustomGE&));
105+ static_assert (!__builtin_gt_synthesizes_from_spaceship (const CustomGE&, const CustomGE&));
106+ static_assert (!__builtin_ge_synthesizes_from_spaceship (const CustomGE&, const CustomGE&));
107107
108108struct CustomLTAndSpaceship {
109109 int i;
@@ -117,10 +117,10 @@ struct CustomLTAndSpaceship {
117117 }
118118};
119119
120- static_assert (!__builtin_lt_synthesises_from_spaceship (const CustomLTAndSpaceship&, const CustomLTAndSpaceship&));
121- static_assert (__builtin_le_synthesises_from_spaceship (const CustomLTAndSpaceship&, const CustomLTAndSpaceship&));
122- static_assert (__builtin_gt_synthesises_from_spaceship (const CustomLTAndSpaceship&, const CustomLTAndSpaceship&));
123- static_assert (__builtin_ge_synthesises_from_spaceship (const CustomLTAndSpaceship&, const CustomLTAndSpaceship&));
120+ static_assert (!__builtin_lt_synthesizes_from_spaceship (const CustomLTAndSpaceship&, const CustomLTAndSpaceship&));
121+ static_assert (__builtin_le_synthesizes_from_spaceship (const CustomLTAndSpaceship&, const CustomLTAndSpaceship&));
122+ static_assert (__builtin_gt_synthesizes_from_spaceship (const CustomLTAndSpaceship&, const CustomLTAndSpaceship&));
123+ static_assert (__builtin_ge_synthesizes_from_spaceship (const CustomLTAndSpaceship&, const CustomLTAndSpaceship&));
124124
125125struct CustomLEAndSpaceship {
126126 int i;
@@ -134,10 +134,10 @@ struct CustomLEAndSpaceship {
134134 }
135135};
136136
137- static_assert (__builtin_lt_synthesises_from_spaceship (const CustomLEAndSpaceship&, const CustomLEAndSpaceship&));
138- static_assert (!__builtin_le_synthesises_from_spaceship (const CustomLEAndSpaceship&, const CustomLEAndSpaceship&));
139- static_assert (__builtin_gt_synthesises_from_spaceship (const CustomLEAndSpaceship&, const CustomLEAndSpaceship&));
140- static_assert (__builtin_ge_synthesises_from_spaceship (const CustomLEAndSpaceship&, const CustomLEAndSpaceship&));
137+ static_assert (__builtin_lt_synthesizes_from_spaceship (const CustomLEAndSpaceship&, const CustomLEAndSpaceship&));
138+ static_assert (!__builtin_le_synthesizes_from_spaceship (const CustomLEAndSpaceship&, const CustomLEAndSpaceship&));
139+ static_assert (__builtin_gt_synthesizes_from_spaceship (const CustomLEAndSpaceship&, const CustomLEAndSpaceship&));
140+ static_assert (__builtin_ge_synthesizes_from_spaceship (const CustomLEAndSpaceship&, const CustomLEAndSpaceship&));
141141
142142struct CustomGTAndSpaceship {
143143 int i;
@@ -151,10 +151,10 @@ struct CustomGTAndSpaceship {
151151 }
152152};
153153
154- static_assert (__builtin_lt_synthesises_from_spaceship (const CustomGTAndSpaceship&, const CustomGTAndSpaceship&));
155- static_assert (__builtin_le_synthesises_from_spaceship (const CustomGTAndSpaceship&, const CustomGTAndSpaceship&));
156- static_assert (!__builtin_gt_synthesises_from_spaceship (const CustomGTAndSpaceship&, const CustomGTAndSpaceship&));
157- static_assert (__builtin_ge_synthesises_from_spaceship (const CustomGTAndSpaceship&, const CustomGTAndSpaceship&));
154+ static_assert (__builtin_lt_synthesizes_from_spaceship (const CustomGTAndSpaceship&, const CustomGTAndSpaceship&));
155+ static_assert (__builtin_le_synthesizes_from_spaceship (const CustomGTAndSpaceship&, const CustomGTAndSpaceship&));
156+ static_assert (!__builtin_gt_synthesizes_from_spaceship (const CustomGTAndSpaceship&, const CustomGTAndSpaceship&));
157+ static_assert (__builtin_ge_synthesizes_from_spaceship (const CustomGTAndSpaceship&, const CustomGTAndSpaceship&));
158158
159159struct CustomGEAndSpaceship {
160160 int i;
@@ -168,10 +168,10 @@ struct CustomGEAndSpaceship {
168168 }
169169};
170170
171- static_assert (__builtin_lt_synthesises_from_spaceship (const CustomGEAndSpaceship&, const CustomGEAndSpaceship&));
172- static_assert (__builtin_le_synthesises_from_spaceship (const CustomGEAndSpaceship&, const CustomGEAndSpaceship&));
173- static_assert (__builtin_gt_synthesises_from_spaceship (const CustomGEAndSpaceship&, const CustomGEAndSpaceship&));
174- static_assert (!__builtin_ge_synthesises_from_spaceship (const CustomGEAndSpaceship&, const CustomGEAndSpaceship&));
171+ static_assert (__builtin_lt_synthesizes_from_spaceship (const CustomGEAndSpaceship&, const CustomGEAndSpaceship&));
172+ static_assert (__builtin_le_synthesizes_from_spaceship (const CustomGEAndSpaceship&, const CustomGEAndSpaceship&));
173+ static_assert (__builtin_gt_synthesizes_from_spaceship (const CustomGEAndSpaceship&, const CustomGEAndSpaceship&));
174+ static_assert (!__builtin_ge_synthesizes_from_spaceship (const CustomGEAndSpaceship&, const CustomGEAndSpaceship&));
175175
176176struct DefaultedCmpAndSpaceship {
177177 int i;
@@ -187,10 +187,10 @@ struct DefaultedCmpAndSpaceship {
187187};
188188
189189// TODO: This should probably return true
190- static_assert (!__builtin_lt_synthesises_from_spaceship (const DefaultedCmpAndSpaceship&, const DefaultedCmpAndSpaceship&));
191- static_assert (!__builtin_le_synthesises_from_spaceship (const DefaultedCmpAndSpaceship&, const DefaultedCmpAndSpaceship&));
192- static_assert (!__builtin_gt_synthesises_from_spaceship (const DefaultedCmpAndSpaceship&, const DefaultedCmpAndSpaceship&));
193- static_assert (!__builtin_ge_synthesises_from_spaceship (const DefaultedCmpAndSpaceship&, const DefaultedCmpAndSpaceship&));
190+ static_assert (!__builtin_lt_synthesizes_from_spaceship (const DefaultedCmpAndSpaceship&, const DefaultedCmpAndSpaceship&));
191+ static_assert (!__builtin_le_synthesizes_from_spaceship (const DefaultedCmpAndSpaceship&, const DefaultedCmpAndSpaceship&));
192+ static_assert (!__builtin_gt_synthesizes_from_spaceship (const DefaultedCmpAndSpaceship&, const DefaultedCmpAndSpaceship&));
193+ static_assert (!__builtin_ge_synthesizes_from_spaceship (const DefaultedCmpAndSpaceship&, const DefaultedCmpAndSpaceship&));
194194
195195struct DifferentTypes {
196196 int i;
@@ -200,13 +200,13 @@ struct DifferentTypes {
200200 }
201201};
202202
203- static_assert (__builtin_lt_synthesises_from_spaceship (const DifferentTypes&, const int &));
204- static_assert (__builtin_le_synthesises_from_spaceship (const DifferentTypes&, const int &));
205- static_assert (__builtin_gt_synthesises_from_spaceship (const DifferentTypes&, const int &));
206- static_assert (__builtin_ge_synthesises_from_spaceship (const DifferentTypes&, const int &));
203+ static_assert (__builtin_lt_synthesizes_from_spaceship (const DifferentTypes&, const int &));
204+ static_assert (__builtin_le_synthesizes_from_spaceship (const DifferentTypes&, const int &));
205+ static_assert (__builtin_gt_synthesizes_from_spaceship (const DifferentTypes&, const int &));
206+ static_assert (__builtin_ge_synthesizes_from_spaceship (const DifferentTypes&, const int &));
207207
208208// TODO: Should this return true? It's technically not synthesized from spaceship, but it behaves exactly as-if it was
209- static_assert (!__builtin_lt_synthesises_from_spaceship (int , int ));
210- static_assert (!__builtin_le_synthesises_from_spaceship (int , int ));
211- static_assert (!__builtin_gt_synthesises_from_spaceship (int , int ));
212- static_assert (!__builtin_ge_synthesises_from_spaceship (int , int ));
209+ static_assert (!__builtin_lt_synthesizes_from_spaceship (int , int ));
210+ static_assert (!__builtin_le_synthesizes_from_spaceship (int , int ));
211+ static_assert (!__builtin_gt_synthesizes_from_spaceship (int , int ));
212+ static_assert (!__builtin_ge_synthesizes_from_spaceship (int , int ));
0 commit comments