Skip to content

Commit f1e78f7

Browse files
committed
[clang][Interp] Handle lvalue APValues in visitAPValueInitializer()
1 parent ea32197 commit f1e78f7

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

clang/lib/AST/Interp/ByteCodeExprGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3188,7 +3188,7 @@ bool ByteCodeExprGen<Emitter>::visitAPValueInitializer(const APValue &Val,
31883188
const APValue &F = Val.getStructField(I);
31893189
const Record::Field *RF = R->getField(I);
31903190

3191-
if (F.isInt()) {
3191+
if (F.isInt() || F.isLValue()) {
31923192
PrimType T = classifyPrim(RF->Decl->getType());
31933193
if (!this->visitAPValue(F, T, E))
31943194
return false;

clang/test/CodeGenCXX/template-param-objects-linkage.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++20 %s -emit-llvm -o - | FileCheck %s
2+
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++20 %s -emit-llvm -o - -fexperimental-new-constant-interpreter | FileCheck %s
23

34
struct S { char buf[32]; };
45
template<S s> constexpr const char* f() { return s.buf; }

0 commit comments

Comments
 (0)