Re: [PATCH] Fix PR c++/71546 - lambda capture fails with "was not declared in this scope"

2018-02-27 Thread Håkon Sandsmark
2018-02-27 22:02 GMT+01:00 Jason Merrill : > On 02/27/2018 03:29 PM, Jason Merrill wrote: >> >> On 02/27/2018 01:51 PM, Håkon Sandsmark wrote: >>> >>> Thanks for the feedback. I chose to take the example from the bug >>> report verbatim as the test case. >>> >>> However, I agree it makes sense to h

Re: [PATCH] Fix PR c++/71546 - lambda capture fails with "was not declared in this scope"

2018-02-27 Thread Jason Merrill
On 02/27/2018 03:29 PM, Jason Merrill wrote: On 02/27/2018 01:51 PM, Håkon Sandsmark wrote: Thanks for the feedback. I chose to take the example from the bug report verbatim as the test case. However, I agree it makes sense to have the simplest possible test case that reproduces the issue. Here

Re: [PATCH] Fix PR c++/71546 - lambda capture fails with "was not declared in this scope"

2018-02-27 Thread Jason Merrill
On 02/27/2018 01:51 PM, Håkon Sandsmark wrote: Thanks for the feedback. I chose to take the example from the bug report verbatim as the test case. However, I agree it makes sense to have the simplest possible test case that reproduces the issue. Here is an updated patch. Thanks! + /* If

Re: [PATCH] Fix PR c++/71546 - lambda capture fails with "was not declared in this scope"

2018-02-27 Thread Håkon Sandsmark
Hi, Thanks for the feedback. I chose to take the example from the bug report verbatim as the test case. However, I agree it makes sense to have the simplest possible test case that reproduces the issue. Here is an updated patch. 2018-02-27 Håkon Sandsmark PR c++/71546 - lambda capture fa

Re: [PATCH] Fix PR c++/71546 - lambda capture fails with "was not declared in this scope"

2018-02-27 Thread Paolo Carlini
.. or even: namespace n { struct make_shared { }; } int main() {   int x1;   [e = n::make_shared (), x1]() {}; } I.e., I don't think the fact that std::make_shared is a template plays a specific role here. Paolo.

Re: [PATCH] Fix PR c++/71546 - lambda capture fails with "was not declared in this scope"

2018-02-27 Thread Paolo Carlini
Hi, I only have a simple comment about the testcase: On 27/02/2018 17:42, Håkon Sandsmark wrote: +++ gcc/testsuite/g++.dg/cpp1y/pr71546.C @@ -0,0 +1,11 @@ +// PR c++/71546 +// { dg-do compile { target c++14 } } +// { dg-options "" } + +#include + +int main() +{ + int x1; + [e = std::make_sha

[PATCH] Fix PR c++/71546 - lambda capture fails with "was not declared in this scope"

2018-02-27 Thread Håkon Sandsmark
Hi GCC developers, I have attached a proposed patch for fixing PR c++/71546 - lambda capture fails with "was not declared in this scope". The patch clears the parser scope after each lambda capture in cp_parser_lambda_introducer in parser.c. This is based on the following observations: Comment a