@@ -86,16 +86,15 @@ namespace DefaultInit {
8686
8787#if __cplusplus >= 202002L
8888namespace SimpleActivate {
89- constexpr int foo () { // ref -error {{never produces a constant expression}}
89+ constexpr int foo () { // both -error {{never produces a constant expression}}
9090 union {
9191 int a;
9292 int b;
9393 } Z;
9494
9595 Z.a = 10 ;
9696 Z.b = 20 ;
97- return Z.a ; // both-note {{read of member 'a' of union with active member 'b'}} \
98- // ref-note {{read of member 'a' of union with active member 'b}}
97+ return Z.a ; // both-note 2{{read of member 'a' of union with active member 'b'}}
9998 }
10099 static_assert (foo() == 20 ); // both-error {{not an integral constant expression}} \
101100 // both-note {{in call to}}
@@ -212,11 +211,10 @@ namespace Nested {
212211 int y;
213212 };
214213
215- constexpr int foo () { // ref -error {{constexpr function never produces a constant expression}}
214+ constexpr int foo () { // both -error {{constexpr function never produces a constant expression}}
216215 U2 u;
217216 u.u .a = 10 ;
218- int a = u.y ; // both-note {{read of member 'y' of union with active member 'u' is not allowed in a constant expression}} \
219- // ref-note {{read of member 'y' of union with active member 'u' is not allowed in a constant expression}}
217+ int a = u.y ; // both-note 2{{read of member 'y' of union with active member 'u' is not allowed in a constant expression}}
220218
221219 return 1 ;
222220 }
@@ -230,24 +228,22 @@ namespace Nested {
230228 }
231229 static_assert (foo2() == 10 );
232230
233- constexpr int foo3 () { // ref -error {{constexpr function never produces a constant expression}}
231+ constexpr int foo3 () { // both -error {{constexpr function never produces a constant expression}}
234232 U2 u;
235233 u.u .a = 10 ;
236- int a = u.u .b ; // both-note {{read of member 'b' of union with active member 'a' is not allowed in a constant expression}} \
237- // ref-note {{read of member 'b' of union with active member 'a' is not allowed in a constant expression}}
234+ int a = u.u .b ; // both-note 2{{read of member 'b' of union with active member 'a' is not allowed in a constant expression}}
238235
239236 return 1 ;
240237 }
241238 static_assert (foo3() == 1 ); // both-error {{not an integral constant expression}} \
242239 // both-note {{in call to}}
243240
244- constexpr int foo4 () { // ref -error {{constexpr function never produces a constant expression}}
241+ constexpr int foo4 () { // both -error {{constexpr function never produces a constant expression}}
245242 U2 u;
246243
247244 u.x = 10 ;
248245
249- return u.u .a ;// both-note {{read of member 'u' of union with active member 'x' is not allowed in a constant expression}} \
250- // ref-note {{read of member 'u' of union with active member 'x' is not allowed in a constant expression}}
246+ return u.u .a ; // both-note 2{{read of member 'u' of union with active member 'x' is not allowed in a constant expression}}
251247 }
252248 static_assert (foo4() == 1 ); // both-error {{not an integral constant expression}} \
253249 // both-note {{in call to}}
0 commit comments