diff --git a/clang/lib/AST/ByteCode/EvalEmitter.cpp b/clang/lib/AST/ByteCode/EvalEmitter.cpp index 9ed61c7b0be78..68f46c113ff28 100644 --- a/clang/lib/AST/ByteCode/EvalEmitter.cpp +++ b/clang/lib/AST/ByteCode/EvalEmitter.cpp @@ -98,10 +98,7 @@ bool EvalEmitter::interpretCall(const FunctionDecl *FD, const Expr *E) { this->Params.insert({PD, {0, false}}); } - if (!this->visit(E)) - return false; - PrimType T = Ctx.classify(E).value_or(PT_Ptr); - return this->emitPop(T, E); + return this->visitExpr(E, /*DestroyToplevelScope=*/false); } void EvalEmitter::emitLabel(LabelTy Label) { CurrentLabel = Label; } diff --git a/clang/test/AST/ByteCode/functions.cpp b/clang/test/AST/ByteCode/functions.cpp index 36e7bb32b2d86..3c00de0102e5a 100644 --- a/clang/test/AST/ByteCode/functions.cpp +++ b/clang/test/AST/ByteCode/functions.cpp @@ -708,3 +708,8 @@ namespace NoDiags { return true; } } + +namespace EnableIfWithTemporary { + struct A { ~A(); }; + int &h() __attribute__((enable_if((A(), true), ""))); // both-warning {{clang extension}} +}