================
@@ -15754,10 +15754,18 @@ bool Expr::EvaluateAsInitializer(APValue &Value,
const ASTContext &Ctx,
LValue LVal;
LVal.set(VD);
- if (!EvaluateInPlace(Value, Info, LVal, this,
- /*AllowNonLiteralTypes=*/true) ||
- EStatus.HasSideEffects)
- return false;
+ {
+ // C++23 [intro.execution]/p5
+ // A full-expression is ... an init-declarator ([dcl.decl]) or a
+ // mem-initializer.
+ // So we need to make sure temporary objects are destroyed after having
+ // evaluated the expression (per C++23 [class.temporary]/p4).
----------------
hahnjo wrote:
Done.
https://github.com/llvm/llvm-project/pull/69076
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits