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

2023-07-20 Thread Hubert Tong via Phabricator via cfe-commits
hubert.reinterpretcast added a comment. In D139586#4363725 , @cor3ntin wrote: > @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

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

2023-07-06 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin abandoned this revision. cor3ntin added a comment. The right way to do that is outline here https://reviews.llvm.org/D153701#4478240 There is no point in trying to keep this attempt around. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2023-06-29 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. In D139586#4403533 , @cor3ntin wrote: > FYI, I'm not actively working on this, > I did mess around with it a bit > https://github.com/cor3ntin/llvm-project/commit/478ff7f1aa7a4046fa8b293dfb86489b930a > but I'm extremely

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

2023-06-07 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. FYI, I'm not actively working on this, I did mess around with it a bit https://github.com/cor3ntin/llvm-project/commit/478ff7f1aa7a4046fa8b293dfb86489b930a but I'm extremely unfamiliar with that part of clang and i have no clue how to write tests. Feel free to

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

2023-05-23 Thread Corentin Jabot via Phabricator via cfe-commits
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 >

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

2023-05-15 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. In D139586#4342868 , @rZhBoYao wrote: > In D139586#4324857 , @cor3ntin > wrote: > >> @rZhBoYao are you still working on this? Thanks! > > No. Sorry that I don't have the capacity to

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

2023-05-15 Thread PoYao Chang via Phabricator via cfe-commits
rZhBoYao abandoned this revision. rZhBoYao added a comment. In D139586#4324857 , @cor3ntin wrote: > @rZhBoYao are you still working on this? Thanks! No. Sorry that I don't have the capacity to work on this. Repository: rG LLVM Github Monorepo

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

2023-05-07 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. @rZhBoYao are you still working on this? Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D139586/new/ https://reviews.llvm.org/D139586 ___ cfe-commits mailing list

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

2023-02-01 Thread Hubert Tong via Phabricator via cfe-commits
hubert.reinterpretcast requested changes to this revision. hubert.reinterpretcast added a comment. This revision now requires changes to proceed. Waiting on changes to fix the visitation to locate the appropriate temporaries. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2023-01-04 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. In D139586#4000309 , @hubert.reinterpretcast wrote: > At least on the surface, it looks like there will be a lot of trouble to deal > with default arguments: > > struct A { A(); ~A(); int x[3]; }; > int ((const A & =

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

2022-12-15 Thread Hubert Tong via Phabricator via cfe-commits
hubert.reinterpretcast added a comment. At least on the surface, it looks like there will be a lot of trouble to deal with default arguments: struct A { A(); ~A(); int x[3]; }; int ((const A & = A()))[3]; void bar(int); void foo() { for (auto e : f()) { bar(e); } } We get a

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

2022-12-15 Thread Hubert Tong via Phabricator via cfe-commits
hubert.reinterpretcast added a comment. In D139586#3984118 , @cor3ntin wrote: > I will try to do a more detailed review later, but at least I think we might > want more tests. Maybe codegen tests that do not rely on > [[clang::lifetimebound]], and

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

2022-12-15 Thread Hubert Tong via Phabricator via cfe-commits
hubert.reinterpretcast added a comment. In D139586#3987252 , @royjacobson wrote: > The (non-wording) paper makes a pretty convincing case to just apply this > retroactively to any C++11 code >

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

2022-12-11 Thread Roy Jacobson via Phabricator via cfe-commits
royjacobson added a comment. Thanks for picking this up! :) The (non-wording) paper makes a pretty convincing case to just apply this retroactively to any C++11 code (https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2644r1.pdf). I think we should apply this retroactively, maybe add a

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

2022-12-09 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. Thanks a lot for working on this. I will try to do a more detailed review later, but at least I think we might want more tests. Maybe codegen tests that do not rely on [[clang::lifetimebound]], and tests with more chaining (`a().b().c()`) . Repository: rG LLVM

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

2022-12-07 Thread PoYao Chang via Phabricator via cfe-commits
rZhBoYao added a comment. Consider: struct T { const int *begin() const; const int *end() const; T () [[clang::lifetimebound]]; T t(); }; const T (const T [[clang::lifetimebound]]) { return t; } T g(); void foo() { for (auto e : f1(g())) {} for (auto e

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

2022-12-07 Thread PoYao Chang via Phabricator via cfe-commits
rZhBoYao created this revision. rZhBoYao added a reviewer: clang-language-wg. Herald added a project: All. rZhBoYao requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Implemented the C++23 paper P2718R0 Repository: rG LLVM Github Monorepo