[PATCH] D139586: [Clang][C++23] Lifetime extension in range-based for loops

Corentin Jabot via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 23 02:12:36 PDT 2023


cor3ntin added a comment.

@hubert.reinterpretcast I'll try to look at that but unless I'm mistaken,  the wording excludes function parameters

> The fourth context is when a temporary object **other than a function parameter** object is created in the for-range-initializer of a range-based for statement. If such a temporary object would otherwise be destroyed at the end of the for-range-initializer full-expression, the object persists for the lifetime of the reference initialized by the for-range-initializer.

I think that invalidates some of your examples?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139586/new/

https://reviews.llvm.org/D139586



More information about the cfe-commits mailing list