Skip to content

Commit 3223838

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 d1827f0 commit 3223838

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

clang/lib/AST/ByteCode/EvalEmitter.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +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))
102-
return false;
103-
PrimType T = Ctx.classify(E).value_or(PT_Ptr);
104-
return this->emitPop(T, E);
101+
return this->visitExpr(E, /*DestroyToplevelScope=*/false);
105102
}
106103

107104
void EvalEmitter::emitLabel(LabelTy Label) { CurrentLabel = Label; }

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), ""))); // both-warning {{clang extension}}
715+
}

0 commit comments

Comments
 (0)