Re: [C++ PATCH] Fix lambda capture duplicate handling (PR c++/89767, take 3 & 4)

2019-03-20 Thread Nathan Sidwell
On 3/20/19 1:15 PM, Jakub Jelinek wrote: On Wed, Mar 20, 2019 at 11:10:19AM -0400, Nathan Sidwell wrote: I was unclear. I was for the lazy creation of the hash. I just think it can be lazily created at either the first or second explicit capture. On top of the https://gcc.gnu.org/ml/gcc-patc

[C++ PATCH] Fix lambda capture duplicate handling (PR c++/89767, take 3 & 4)

2019-03-20 Thread Jakub Jelinek
On Wed, Mar 20, 2019 at 11:10:19AM -0400, Nathan Sidwell wrote: > I was unclear. I was for the lazy creation of the hash. I just think it > can be lazily created at either the first or second explicit capture. On top of the https://gcc.gnu.org/ml/gcc-patches/2019-03/msg00991.html patch I've just

Re: [C++ PATCH] Fix lambda capture duplicate handling (PR c++/89767)

2019-03-20 Thread Nathan Sidwell
On 3/20/19 10:48 AM, Jakub Jelinek wrote: On Wed, Mar 20, 2019 at 10:34:51AM -0400, Nathan Sidwell wrote: On 3/19/19 2:14 PM, Jakub Jelinek wrote: add_capture when parsing a lambda introducer uses the IDENTIFIER_MARKED bit to detect duplicate captures. I guess in strict C++11 that could have wo

Re: [C++ PATCH] Fix lambda capture duplicate handling (PR c++/89767)

2019-03-20 Thread Jakub Jelinek
On Wed, Mar 20, 2019 at 10:34:51AM -0400, Nathan Sidwell wrote: > On 3/19/19 2:14 PM, Jakub Jelinek wrote: > > add_capture when parsing a lambda introducer uses the IDENTIFIER_MARKED > > bit to detect duplicate captures. > > I guess in strict C++11 that could have worked, if the introducer could >

Re: [C++ PATCH] Fix lambda capture duplicate handling (PR c++/89767)

2019-03-20 Thread Nathan Sidwell
On 3/19/19 2:14 PM, Jakub Jelinek wrote: Hi! add_capture when parsing a lambda introducer uses the IDENTIFIER_MARKED bit to detect duplicate captures. I guess in strict C++11 that could have worked, if the introducer could contain just identifiers, but in C++14 it has 2 problems: The followin

[C++ PATCH] Fix lambda capture duplicate handling (PR c++/89767)

2019-03-19 Thread Jakub Jelinek
Hi! add_capture when parsing a lambda introducer uses the IDENTIFIER_MARKED bit to detect duplicate captures. I guess in strict C++11 that could have worked, if the introducer could contain just identifiers, but in C++14 it has 2 problems: 1) lambda initializers can contain arbitrary expressions