================
@@ -7849,13 +7854,17 @@ class Sema final : public SemaBase {
   /// keepInLifetimeExtendingContext - Pull down InLifetimeExtendingContext
   /// flag from previous context.
   void keepInLifetimeExtendingContext() {
-    if (ExprEvalContexts.size() > 2 &&
-        parentEvaluationContext().InLifetimeExtendingContext) {
-      auto &LastRecord = ExprEvalContexts.back();
-      auto &PrevRecord = parentEvaluationContext();
-      LastRecord.InLifetimeExtendingContext =
-          PrevRecord.InLifetimeExtendingContext;
-    }
+    if (ExprEvalContexts.size() > 2)
----------------
cor3ntin wrote:

I wonder if this `2` is correct. Pre-existing but it should probably be `1` 
(ie, if there are more than 1 context, there is a parent. Maybe we should just 
assert >1 actually
(there is always going a context bot the default init + 1 for the translation 
unit)

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

Reply via email to