================
@@ -7810,9 +7813,11 @@ class Sema final : public SemaBase {
   }
 
   bool isInLifetimeExtendingContext() const {
-    assert(!ExprEvalContexts.empty() &&
----------------
yronglin wrote:

We check `isInLifetimeExtendingContext` when we create a 
`MaterializedTemporaryExpr`, if in a lifetime extend context, we will collect 
created MaterializedTemporaryExprs and extend its lifetime to a variable. 
e.g. (P2718R0 - Lifetime extension in range-based for loops.)In a for-range 
statement, we collect temporaries in for-range-init, and extend it's lifetime 
bound to for-range-var.

https://github.com/llvm/llvm-project/pull/108039
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to