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

via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 22 06:56:37 PST 2024


================
@@ -1357,6 +1363,19 @@ class Sema final {
     // VLAs).
     bool InConditionallyConstantEvaluateContext = false;
 
+    /// Whether we are currently in a context in which temporaries must be
+    /// lifetime-extended (Eg. in a for-range initializer).
+    bool IsInLifetimeExtendingContext = false;
----------------
yronglin wrote:

agree

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


More information about the cfe-commits mailing list