[PATCH] D123909: [Clang] Use of decltype(capture) in parameter-declaration-clause

2022-04-20 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D123909#3462791 , @rsmith wrote: > In D123909#3462560 , @aaron.ballman > wrote: > >> This looks like a true positive to me, at least for the moment (Core is >> still trying to

[PATCH] D123909: [Clang] Use of decltype(capture) in parameter-declaration-clause

2022-04-20 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In D123909#3462560 , @aaron.ballman wrote: > This looks like a true positive to me, at least for the moment (Core is still > trying to decide what to do about CWG2569 which may relax some restrictions > in this area). > >

[PATCH] D123909: [Clang] Use of decltype(capture) in parameter-declaration-clause

2022-04-20 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a subscriber: MaskRay. aaron.ballman added a comment. In D123909#3461716 , @hokein wrote: > Hi, this patch seems to break the following code which was previously > compiled: > > #include > #include > #include > >

[PATCH] D123909: [Clang] Use of decltype(capture) in parameter-declaration-clause

2022-04-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Hi, this patch seems to break the following code which was previously compiled: #include #include #include template auto MapJoin(It first, It last, MapFn map_fn) { return std::accumulate( first, last, map_fn(*first), [=](typename

[PATCH] D123909: [Clang] Use of decltype(capture) in parameter-declaration-clause

2022-04-18 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. @aaron.ballman @erichkeane Thanks for the review - I've landed it. Hopefully the remediation should be enough so that libstdc++ is no longer affected but we should still keep an eye out for further issues Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D123909: [Clang] Use of decltype(capture) in parameter-declaration-clause

2022-04-18 Thread Corentin Jabot via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGdaa6d7b250ed: [Clang] Use of decltype(capture) in parameter-declaration-clause (authored by cor3ntin). Repository: rG LLVM Github Monorepo

[PATCH] D123909: [Clang] Use of decltype(capture) in parameter-declaration-clause

2022-04-18 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 423370. cor3ntin added a comment. ... and we don't need a local variable anymore either Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123909/new/ https://reviews.llvm.org/D123909 Files:

[PATCH] D123909: [Clang] Use of decltype(capture) in parameter-declaration-clause

2022-04-18 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 423368. cor3ntin added a comment. Thanks Aaron, let's pretend this did not happen :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123909/new/ https://reviews.llvm.org/D123909 Files:

[PATCH] D123909: [Clang] Use of decltype(capture) in parameter-declaration-clause

2022-04-18 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision as: aaron.ballman. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM aside from a nit (forgot to remove a line covered by RAII). Comment at: clang/lib/Sema/SemaExpr.cpp:2704-2712 + ExprResult Res =

[PATCH] D123909: [Clang] Use of decltype(capture) in parameter-declaration-clause

2022-04-18 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:2703 + UnqualifiedId ) { + InMutableAgnosticContext = true; + ExprResult Res = ActOnIdExpression(S, SS, /*TemplateKwLoc*/ erichkeane wrote:

[PATCH] D123909: [Clang] Use of decltype(capture) in parameter-declaration-clause

2022-04-18 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 423367. cor3ntin added a comment. - Use a RAII class to control InMutableAgnosticContext - Formatting Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123909/new/ https://reviews.llvm.org/D123909 Files:

[PATCH] D123909: [Clang] Use of decltype(capture) in parameter-declaration-clause

2022-04-18 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 423365. cor3ntin added a comment. - Add a release note - Add tests for lookup errors in decltype expressions in lambda parameters clause Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123909/new/

[PATCH] D123909: [Clang] Use of decltype(capture) in parameter-declaration-clause

2022-04-18 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. 1 nit, otherwise no comments. Comment at: clang/lib/Sema/SemaExpr.cpp:2703 + UnqualifiedId ) { + InMutableAgnosticContext = true; + ExprResult Res = ActOnIdExpression(S, SS, /*TemplateKwLoc*/

[PATCH] D123909: [Clang] Use of decltype(capture) in parameter-declaration-clause

2022-04-18 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/lib/Parse/ParseExprCXX.cpp:700 + + if (Tok.is(tok::identifier) && NextToken().is(tok::r_paren)) { +SourceLocation TemplateKWLoc; aaron.ballman wrote: > cor3ntin wrote: > > aaron.ballman wrote: > > > cor3ntin

[PATCH] D123909: [Clang] Use of decltype(capture) in parameter-declaration-clause

2022-04-18 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Parse/ParseExprCXX.cpp:700 + + if (Tok.is(tok::identifier) && NextToken().is(tok::r_paren)) { +SourceLocation TemplateKWLoc; cor3ntin wrote: > aaron.ballman wrote: > > cor3ntin wrote: > > >

[PATCH] D123909: [Clang] Use of decltype(capture) in parameter-declaration-clause

2022-04-18 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/lib/Parse/ParseExprCXX.cpp:700 + + if (Tok.is(tok::identifier) && NextToken().is(tok::r_paren)) { +SourceLocation TemplateKWLoc; aaron.ballman wrote: > cor3ntin wrote: > > aaron.ballman wrote: > > > This

[PATCH] D123909: [Clang] Use of decltype(capture) in parameter-declaration-clause

2022-04-18 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. We should probably add a release note that says we partially implement CWG 2569 (just the `decltype` portion) and that the core issue has not yet been approved by WG21 but the changes are needed to keep libstdc++ working. Comment at:

[PATCH] D123909: [Clang] Use of decltype(capture) in parameter-declaration-clause

2022-04-18 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Sema/Sema.h:5281 + SourceLocation TemplateKwLoc, + bool HasTrailingLParen); + cor3ntin wrote: >

[PATCH] D123909: [Clang] Use of decltype(capture) in parameter-declaration-clause

2022-04-18 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 423363. cor3ntin marked an inline comment as done. cor3ntin added a comment. Address Aaron's feedback - Typos - Remove unused parameters - return ExprError() if ParseUnqualifiedId fails. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D123909: [Clang] Use of decltype(capture) in parameter-declaration-clause

2022-04-18 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/include/clang/Sema/Sema.h:5281 + SourceLocation TemplateKwLoc, + bool HasTrailingLParen); + aaron.ballman wrote: > This

[PATCH] D123909: [Clang] Use of decltype(capture) in parameter-declaration-clause

2022-04-18 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/lib/Parse/ParseExprCXX.cpp:700 + + if (Tok.is(tok::identifier) && NextToken().is(tok::r_paren)) { +SourceLocation TemplateKWLoc; aaron.ballman wrote: > This feels surprisingly restrictive to me, but it's

[PATCH] D123909: [Clang] Use of decltype(capture) in parameter-declaration-clause

2022-04-18 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Sema/Sema.h:5281 + SourceLocation TemplateKwLoc, + bool HasTrailingLParen); + This parameter is always

[PATCH] D123909: [Clang] Use of decltype(capture) in parameter-declaration-clause

2022-04-17 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin created this revision. Herald added a project: All. cor3ntin requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Partially implement the proposed resolution to CWG2569. D119136 broke some libstdc++