Skip to content

Commit 9a9e326

Browse files
committed
Fix test so it's actually checking constexpr-unknown.
1 parent 51b5621 commit 9a9e326

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

clang/test/SemaCXX/constant-expression-p2280r4.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,8 @@ namespace GH150015 {
392392
struct X {};
393393
struct Y {};
394394
struct Z : X, Y {};
395-
extern Z z;
396-
constexpr int bases = (void*)(X*)&z <= (Y*)&z; // nointerpreter-error {{constexpr variable 'bases' must be initialized by a constant expression}} \
397-
// nointerpreter-note {{comparison of addresses of subobjects of different base classes has unspecified value}}
395+
extern Z &z; // interpreter-note{{declared here}}
396+
constexpr int bases = (void*)(X*)&z <= (Y*)&z; // expected-error {{constexpr variable 'bases' must be initialized by a constant expression}} \
397+
// nointerpreter-note {{comparison of addresses of subobjects of different base classes has unspecified value}} \
398+
// interpreter-note {{initializer of 'z' is unknown}}
398399
}

0 commit comments

Comments
 (0)