Skip to content

Commit ae82743

Browse files
committed
[clang][bytecode] Use visitExpr() in interpretCall
This is the correct function to use and it will create a variable scope. Fixes #152822
1 parent b4e8b8e commit ae82743

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

clang/lib/AST/ByteCode/EvalEmitter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ bool EvalEmitter::interpretCall(const FunctionDecl *FD, const Expr *E) {
9898
this->Params.insert({PD, {0, false}});
9999
}
100100

101-
if (!this->visit(E))
101+
if (!this->visitExpr(E, /*DestroyToplevelScope=*/true))
102102
return false;
103103
PrimType T = Ctx.classify(E).value_or(PT_Ptr);
104104
return this->emitPop(T, E);

clang/test/AST/ByteCode/functions.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,3 +708,8 @@ namespace NoDiags {
708708
return true;
709709
}
710710
}
711+
712+
namespace EnableIfWithTemporary {
713+
struct A { ~A(); };
714+
int &h() __attribute__((enable_if((A(), true), "")));
715+
}

0 commit comments

Comments
 (0)