@@ -93,7 +93,7 @@ struct A;
93
93
void f () {
94
94
constexpr A* a = nullptr ;
95
95
constexpr int p = &*a;
96
- // expected -error@-1 {{cannot initialize a variable of type 'const int' with an rvalue of type 'A *'}}
96
+ // since-cxx11 -error@-1 {{cannot initialize a variable of type 'const int' with an rvalue of type 'A *'}}
97
97
constexpr A *p2 = &*a;
98
98
}
99
99
@@ -108,27 +108,27 @@ namespace cwg1460 { // cwg1460: 3.5
108
108
namespace DRExample {
109
109
union A {
110
110
union {};
111
- // expected -error@-1 {{declaration does not declare anything}}
111
+ // since-cxx11 -error@-1 {{declaration does not declare anything}}
112
112
union {};
113
- // expected -error@-1 {{declaration does not declare anything}}
113
+ // since-cxx11 -error@-1 {{declaration does not declare anything}}
114
114
constexpr A () {}
115
115
};
116
116
constexpr A a = A();
117
117
118
118
union B {
119
119
union {};
120
- // expected -error@-1 {{declaration does not declare anything}}
120
+ // since-cxx11 -error@-1 {{declaration does not declare anything}}
121
121
union {};
122
- // expected -error@-1 {{declaration does not declare anything}}
122
+ // since-cxx11 -error@-1 {{declaration does not declare anything}}
123
123
constexpr B () = default ;
124
124
};
125
125
constexpr B b = B();
126
126
127
127
union C {
128
128
union {};
129
- // expected -error@-1 {{declaration does not declare anything}}
129
+ // since-cxx11 -error@-1 {{declaration does not declare anything}}
130
130
union {};
131
- // expected -error@-1 {{declaration does not declare anything}}
131
+ // since-cxx11 -error@-1 {{declaration does not declare anything}}
132
132
};
133
133
constexpr C c = C();
134
134
#if __cplusplus >= 201403L
@@ -141,7 +141,7 @@ namespace cwg1460 { // cwg1460: 3.5
141
141
union B { int n; }; // #cwg1460-B
142
142
union C { int n = 0 ; };
143
143
struct D { union {}; };
144
- // expected -error@-1 {{declaration does not declare anything}}
144
+ // since-cxx11 -error@-1 {{declaration does not declare anything}}
145
145
struct E { union { int n; }; }; // #cwg1460-E
146
146
struct F { union { int n = 0 ; }; };
147
147
@@ -173,7 +173,7 @@ namespace cwg1460 { // cwg1460: 3.5
173
173
// cxx11-17-error@-1 {{defaulted definition of default constructor cannot be marked constexpr}}
174
174
union C { int n = 0 ; constexpr C () = default ; };
175
175
struct D { union {}; constexpr D () = default; };
176
- // expected -error@-1 {{declaration does not declare anything}}
176
+ // since-cxx11 -error@-1 {{declaration does not declare anything}}
177
177
struct E { union { int n; }; constexpr E () = default; };
178
178
// cxx11-17-error@-1 {{defaulted definition of default constructor cannot be marked constexpr}}
179
179
struct F { union { int n = 0 ; }; constexpr F () = default; };
@@ -222,25 +222,25 @@ namespace cwg1460 { // cwg1460: 3.5
222
222
union G {
223
223
int a = 0 ; // #cwg1460-G-a
224
224
int b = 0 ;
225
- // expected -error@-1 {{initializing multiple members of union}}
226
- // expected -note@#cwg1460-G-a {{previous initialization is here}}
225
+ // since-cxx11 -error@-1 {{initializing multiple members of union}}
226
+ // since-cxx11 -note@#cwg1460-G-a {{previous initialization is here}}
227
227
};
228
228
union H {
229
229
union {
230
230
int a = 0 ; // #cwg1460-H-a
231
231
};
232
232
union {
233
233
int b = 0 ;
234
- // expected -error@-1 {{initializing multiple members of union}}
235
- // expected -note@#cwg1460-H-a {{previous initialization is here}}
234
+ // since-cxx11 -error@-1 {{initializing multiple members of union}}
235
+ // since-cxx11 -note@#cwg1460-H-a {{previous initialization is here}}
236
236
};
237
237
};
238
238
struct I {
239
239
union {
240
240
int a = 0 ; // #cwg1460-I-a
241
241
int b = 0 ;
242
- // expected -error@-1 {{initializing multiple members of union}}
243
- // expected -note@#cwg1460-I-a {{previous initialization is here}}
242
+ // since-cxx11 -error@-1 {{initializing multiple members of union}}
243
+ // since-cxx11 -note@#cwg1460-I-a {{previous initialization is here}}
244
244
};
245
245
};
246
246
struct J {
@@ -264,23 +264,23 @@ namespace cwg1460 { // cwg1460: 3.5
264
264
};
265
265
static_assert (B().a == 1 , " " );
266
266
static_assert (B().b == 2 , " " );
267
- // expected -error@-1 {{static assertion expression is not an integral constant expression}}
268
- // expected -note@-2 {{read of member 'b' of union with active member 'a' is not allowed in a constant expression}}
267
+ // since-cxx11 -error@-1 {{static assertion expression is not an integral constant expression}}
268
+ // since-cxx11 -note@-2 {{read of member 'b' of union with active member 'a' is not allowed in a constant expression}}
269
269
static_assert (B(' x' ).a == 0 , " " );
270
- // expected -error@-1 {{static assertion expression is not an integral constant expression}}
271
- // expected -note@-2 {{read of member 'a' of union with active member 'b' is not allowed in a constant expression}}
270
+ // since-cxx11 -error@-1 {{static assertion expression is not an integral constant expression}}
271
+ // since-cxx11 -note@-2 {{read of member 'a' of union with active member 'b' is not allowed in a constant expression}}
272
272
static_assert (B(' x' ).b == 4 , " " );
273
273
static_assert (B(123 ).b == 2 , " " );
274
- // expected -error@-1 {{static assertion expression is not an integral constant expression}}
275
- // expected -note@-2 {{read of member 'b' of union with active member 'c' is not allowed in a constant expression}}
274
+ // since-cxx11 -error@-1 {{static assertion expression is not an integral constant expression}}
275
+ // since-cxx11 -note@-2 {{read of member 'b' of union with active member 'c' is not allowed in a constant expression}}
276
276
static_assert (B(123 ).c == 3 , " " );
277
277
static_assert (B(" " ).a == 1 , " " );
278
- // expected -error@-1 {{static assertion expression is not an integral constant expression}}
279
- // expected -note@-2 {{read of member 'a' of union with active member 'b' is not allowed in a constant expression}}
278
+ // since-cxx11 -error@-1 {{static assertion expression is not an integral constant expression}}
279
+ // since-cxx11 -note@-2 {{read of member 'a' of union with active member 'b' is not allowed in a constant expression}}
280
280
static_assert (B(" " ).b == 2 , " " );
281
281
static_assert (B(" " ).c == 3 , " " );
282
- // expected -error@-1 {{static assertion expression is not an integral constant expression}}
283
- // expected -note@-2 {{read of member 'c' of union with active member 'b' is not allowed in a constant expression}}
282
+ // since-cxx11 -error@-1 {{static assertion expression is not an integral constant expression}}
283
+ // since-cxx11 -note@-2 {{read of member 'c' of union with active member 'b' is not allowed in a constant expression}}
284
284
285
285
struct C {
286
286
union { int a, b = 2 , c; };
@@ -294,54 +294,54 @@ namespace cwg1460 { // cwg1460: 3.5
294
294
295
295
static_assert (C().a == 1 , " " );
296
296
static_assert (C().b == 2 , " " );
297
- // expected -error@-1 {{static assertion expression is not an integral constant expression}}
298
- // expected -note@-2 {{read of member 'b' of union with active member 'a' is not allowed in a constant expression}}
297
+ // since-cxx11 -error@-1 {{static assertion expression is not an integral constant expression}}
298
+ // since-cxx11 -note@-2 {{read of member 'b' of union with active member 'a' is not allowed in a constant expression}}
299
299
static_assert (C().d == 4 , " " );
300
- // expected -error@-1 {{static assertion expression is not an integral constant expression}}
301
- // expected -note@-2 {{read of member 'd' of union with active member 'e' is not allowed in a constant expression}}
300
+ // since-cxx11 -error@-1 {{static assertion expression is not an integral constant expression}}
301
+ // since-cxx11 -note@-2 {{read of member 'd' of union with active member 'e' is not allowed in a constant expression}}
302
302
static_assert (C().e == 5 , " " );
303
303
304
304
static_assert (C(' x' ).b == 2 , " " );
305
- // expected -error@-1 {{static assertion expression is not an integral constant expression}}
306
- // expected -note@-2 {{read of member 'b' of union with active member 'c' is not allowed in a constant expression}}
305
+ // since-cxx11 -error@-1 {{static assertion expression is not an integral constant expression}}
306
+ // since-cxx11 -note@-2 {{read of member 'b' of union with active member 'c' is not allowed in a constant expression}}
307
307
static_assert (C(' x' ).c == 3 , " " );
308
308
static_assert (C(' x' ).d == 4 , " " );
309
- // expected -error@-1 {{static assertion expression is not an integral constant expression}}
310
- // expected -note@-2 {{read of member 'd' of union with active member 'e' is not allowed in a constant expression}}
309
+ // since-cxx11 -error@-1 {{static assertion expression is not an integral constant expression}}
310
+ // since-cxx11 -note@-2 {{read of member 'd' of union with active member 'e' is not allowed in a constant expression}}
311
311
static_assert (C(' x' ).e == 5 , " " );
312
312
313
313
static_assert (C(1 ).b == 2 , " " );
314
314
static_assert (C(1 ).c == 3 , " " );
315
- // expected -error@-1 {{static assertion expression is not an integral constant expression}}
316
- // expected -note@-2 {{read of member 'c' of union with active member 'b' is not allowed in a constant expression}}
315
+ // since-cxx11 -error@-1 {{static assertion expression is not an integral constant expression}}
316
+ // since-cxx11 -note@-2 {{read of member 'c' of union with active member 'b' is not allowed in a constant expression}}
317
317
static_assert (C(1 ).d == 4 , " " );
318
318
static_assert (C(1 ).e == 5 , " " );
319
- // expected -error@-1 {{static assertion expression is not an integral constant expression}}
320
- // expected -note@-2 {{read of member 'e' of union with active member 'd' is not allowed in a constant expression}}
319
+ // since-cxx11 -error@-1 {{static assertion expression is not an integral constant expression}}
320
+ // since-cxx11 -note@-2 {{read of member 'e' of union with active member 'd' is not allowed in a constant expression}}
321
321
322
322
static_assert (C(1 .f).b == 2 , " " );
323
323
static_assert (C(1 .f).c == 3 , " " );
324
- // expected -error@-1 {{static assertion expression is not an integral constant expression}}
325
- // expected -note@-2 {{read of member 'c' of union with active member 'b' is not allowed in a constant expression}}
324
+ // since-cxx11 -error@-1 {{static assertion expression is not an integral constant expression}}
325
+ // since-cxx11 -note@-2 {{read of member 'c' of union with active member 'b' is not allowed in a constant expression}}
326
326
static_assert (C(1 .f).e == 5 , " " );
327
- // expected -error@-1 {{static assertion expression is not an integral constant expression}}
328
- // expected -note@-2 {{read of member 'e' of union with active member 'f' is not allowed in a constant expression}}
327
+ // since-cxx11 -error@-1 {{static assertion expression is not an integral constant expression}}
328
+ // since-cxx11 -note@-2 {{read of member 'e' of union with active member 'f' is not allowed in a constant expression}}
329
329
static_assert (C(1 .f).f == 6 , " " );
330
330
331
331
static_assert (C(" " ).a == 1 , " " );
332
- // expected -error@-1 {{static assertion expression is not an integral constant expression}}
333
- // expected -note@-2 {{read of member 'a' of union with active member 'b' is not allowed in a constant expression}}
332
+ // since-cxx11 -error@-1 {{static assertion expression is not an integral constant expression}}
333
+ // since-cxx11 -note@-2 {{read of member 'a' of union with active member 'b' is not allowed in a constant expression}}
334
334
static_assert (C(" " ).b == 2 , " " );
335
335
static_assert (C(" " ).c == 3 , " " );
336
- // expected -error@-1 {{static assertion expression is not an integral constant expression}}
337
- // expected -note@-2 {{read of member 'c' of union with active member 'b' is not allowed in a constant expression}}
336
+ // since-cxx11 -error@-1 {{static assertion expression is not an integral constant expression}}
337
+ // since-cxx11 -note@-2 {{read of member 'c' of union with active member 'b' is not allowed in a constant expression}}
338
338
static_assert (C(" " ).d == 4 , " " );
339
- // expected -error@-1 {{static assertion expression is not an integral constant expression}}
340
- // expected -note@-2 {{read of member 'd' of union with active member 'e' is not allowed in a constant expression}}
339
+ // since-cxx11 -error@-1 {{static assertion expression is not an integral constant expression}}
340
+ // since-cxx11 -note@-2 {{read of member 'd' of union with active member 'e' is not allowed in a constant expression}}
341
341
static_assert (C(" " ).e == 5 , " " );
342
342
static_assert (C(" " ).f == 6 , " " );
343
- // expected -error@-1 {{static assertion expression is not an integral constant expression}}
344
- // expected -note@-2 {{read of member 'f' of union with active member 'e' is not allowed in a constant expression}}
343
+ // since-cxx11 -error@-1 {{static assertion expression is not an integral constant expression}}
344
+ // since-cxx11 -note@-2 {{read of member 'f' of union with active member 'e' is not allowed in a constant expression}}
345
345
346
346
struct D ;
347
347
extern const D d;
0 commit comments