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 fails with "was not declared in this scope" * parser.c (cp_parser_lambda_introducer): Clear scope after each lambda capture. * g++.dg/cpp1y/pr71546.C: New test. 2018-02-27 19:15 GMT+01:00 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.