Skip to content

Commit 00c622e

Browse files
committed
[clang][Interp][Test] Add test for #97302
Fixes #97302
1 parent d6e5b14 commit 00c622e

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)