[clang] [Clang] Implement P2718R0 "Lifetime extension in range-based for loops" (PR #76361)

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 17 12:18:45 PST 2024


================
@@ -9959,6 +9976,18 @@ class Sema final {
     return currentEvaluationContext().isImmediateFunctionContext();
   }
 
+  bool isInLifetimeExtendingContext() const {
+    assert(!ExprEvalContexts.empty() &&
+           "Must be in an expression evaluation context");
+    return ExprEvalContexts.back().IsInLifetimeExtendingContext;
+  }
+
+  bool ShouldMaterializePRValueInDiscardedExpression() const {
----------------
zygoloid wrote:

Is there a reason that this is capitalized and the function above is not? (Genuine question, I've lost track of LLVM's preferred capitalization rule for functions, but this locally looks inconsistent.)

https://github.com/llvm/llvm-project/pull/76361


More information about the cfe-commits mailing list