[clang] [clang] Fix lifetime extension of temporaries in for-range-initializers in templates (PR #177191)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 21 08:11:26 PST 2026
================
@@ -3017,6 +3009,13 @@ StmtResult Sema::BuildCXXForRangeStmt(
if (getLangOpts().OpenMP >= 50 && BeginDeclStmt.isUsable())
OpenMP().ActOnOpenMPLoopInitialization(ForLoc, BeginDeclStmt.get());
+ // P2718R0 - Lifetime extension in range-based for loops.
----------------
erichkeane wrote:
I'm not quite sure I get why this works? Can you explain what the problem is better?
https://github.com/llvm/llvm-project/pull/177191
More information about the cfe-commits
mailing list