[clang] Reapply "[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer" (PR #108039)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 11 08:10:11 PDT 2024
================
@@ -2509,8 +2509,9 @@ Parser::DeclGroupPtrTy Parser::ParseDeclGroup(ParsingDeclSpec &DS,
// P2718R0 - Lifetime extension in range-based for loops.
if (getLangOpts().CPlusPlus23) {
- auto &LastRecord = Actions.ExprEvalContexts.back();
+ auto &LastRecord = Actions.currentEvaluationContext();
LastRecord.InLifetimeExtendingContext = true;
+ LastRecord.RebuildDefaultArgOrDefaultInit = true;
----------------
erichkeane wrote:
Ah, i see that now. Thanks for the clarification!
https://github.com/llvm/llvm-project/pull/108039
More information about the cfe-commits
mailing list