@@ -5,65 +5,49 @@ namespace Throw {
5
5
6
6
constexpr int ConditionalThrow (bool t) {
7
7
if (t)
8
- throw 4 ; // expected-note {{subexpression not valid in a constant expression}} \
9
- // ref-note {{subexpression not valid in a constant expression}}
8
+ throw 4 ; // both-note {{subexpression not valid in a constant expression}}
10
9
11
10
return 0 ;
12
11
}
13
12
14
13
static_assert (ConditionalThrow(false ) == 0 , " " );
15
- static_assert (ConditionalThrow(true ) == 0 , " " ); // expected-error {{not an integral constant expression}} \
16
- // expected-note {{in call to 'ConditionalThrow(true)'}} \
17
- // ref-error {{not an integral constant expression}} \
18
- // ref-note {{in call to 'ConditionalThrow(true)'}}
14
+ static_assert (ConditionalThrow(true ) == 0 , " " ); // both-error {{not an integral constant expression}} \
15
+ // both-note {{in call to 'ConditionalThrow(true)'}}
19
16
20
- constexpr int Throw () { // expected-error {{never produces a constant expression}} \
21
- // ref-error {{never produces a constant expression}}
22
- throw 5 ; // expected-note {{subexpression not valid in a constant expression}} \
23
- // ref-note {{subexpression not valid in a constant expression}}
17
+ constexpr int Throw () { // both-error {{never produces a constant expression}}
18
+ throw 5 ; // both-note {{subexpression not valid in a constant expression}}
24
19
return 0 ;
25
20
}
26
21
27
- constexpr int NoSubExpr () { // ref-error {{never produces a constant expression}} \
28
- // expected-error {{never produces a constant expression}}
29
- throw ; // ref-note 2{{subexpression not valid}} \
30
- // expected-note 2{{subexpression not valid}}
22
+ constexpr int NoSubExpr () { // both-error {{never produces a constant expression}}
23
+ throw ; // both-note 2{{subexpression not valid}}
31
24
return 0 ;
32
25
}
33
- static_assert (NoSubExpr() == 0 , " " ); // ref-error {{not an integral constant expression}} \
34
- // ref-note {{in call to}} \
35
- // expected-error {{not an integral constant expression}} \
36
- // expected-note {{in call to}}
26
+ static_assert (NoSubExpr() == 0 , " " ); // both-error {{not an integral constant expression}} \
27
+ // both-note {{in call to}}
37
28
}
38
29
39
30
namespace Asm {
40
31
constexpr int ConditionalAsm (bool t) {
41
32
if (t)
42
- asm (" " ); // expected-note {{subexpression not valid in a constant expression}} \
43
- // ref-note {{subexpression not valid in a constant expression}}
33
+ asm (" " ); // both-note {{subexpression not valid in a constant expression}}
44
34
45
35
return 0 ;
46
36
}
47
37
static_assert (ConditionalAsm(false ) == 0 , " " );
48
- static_assert (ConditionalAsm(true ) == 0 , " " ); // expected-error {{not an integral constant expression}} \
49
- // expected-note {{in call to 'ConditionalAsm(true)'}} \
50
- // ref-error {{not an integral constant expression}} \
51
- // ref-note {{in call to 'ConditionalAsm(true)'}}
38
+ static_assert (ConditionalAsm(true ) == 0 , " " ); // both-error {{not an integral constant expression}} \
39
+ // both-note {{in call to 'ConditionalAsm(true)'}}
52
40
53
41
54
- constexpr int Asm () { // expected-error {{never produces a constant expression}} \
55
- // ref-error {{never produces a constant expression}}
56
- __asm volatile (" " ); // expected-note {{subexpression not valid in a constant expression}} \
57
- // ref-note {{subexpression not valid in a constant expression}}
42
+ constexpr int Asm () { // both-error {{never produces a constant expression}}
43
+ __asm volatile (" " ); // both-note {{subexpression not valid in a constant expression}}
58
44
return 0 ;
59
45
}
60
46
}
61
47
62
48
namespace Casts {
63
- constexpr int a = reinterpret_cast <int >(12 ); // expected-error {{must be initialized by a constant expression}} \
64
- // expected-note {{reinterpret_cast is not allowed}} \
65
- // ref-error {{must be initialized by a constant expression}} \
66
- // ref-note {{reinterpret_cast is not allowed}}
49
+ constexpr int a = reinterpret_cast <int >(12 ); // both-error {{must be initialized by a constant expression}} \
50
+ // both-note {{reinterpret_cast is not allowed}}
67
51
68
52
void func () {
69
53
struct B {};
0 commit comments