Skip to content

Commit a5e2f75

Browse files
tbaederrkbluck
authored andcommitted
[clang][Interp][Test] Add test for llvm#97302
Fixes llvm#97302
1 parent ad7b2b2 commit a5e2f75

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

clang/test/AST/Interp/records.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,12 @@ namespace DeclRefs {
494494
constexpr B b;
495495
static_assert(b.a.m == 100, "");
496496
static_assert(b.a.f == 100, "");
497+
498+
constexpr B b2;
499+
static_assert(b2.a.m == 100, "");
500+
static_assert(b2.a.f == 100, "");
501+
static_assert(b2.a.f == 101, ""); // both-error {{failed}} \
502+
// both-note {{evaluates to '100 == 101'}}
497503
}
498504

499505
namespace PointerArith {

0 commit comments

Comments
 (0)