mirror of
https://forge.sourceware.org/marek/gcc.git
synced 2026-02-22 12:00:11 -05:00
PR c++/89767 * parser.c (cp_parser_lambda_introducer): Add ids and first_capture_id variables, check for duplicates in this function. * lambda.c (add_capture): Don't check for duplicates nor use IDENTIFIER_MARKED. (register_capture_members): Don't clear IDENTIFIER_MARKED here. * g++.dg/cpp1y/lambda-init18.C: New test. * g++.dg/cpp1y/lambda-init19.C: New test. * g++.dg/cpp1y/pr89767.C: New test. From-SVN: r269860
13 lines
166 B
C
13 lines
166 B
C
// PR c++/89767
|
|
// { dg-do compile { target c++14 } }
|
|
|
|
void bar (int);
|
|
|
|
void
|
|
foo ()
|
|
{
|
|
int x = 0;
|
|
auto z = [x, y = [x] { bar (x); }] { y (); bar (x); };
|
|
z ();
|
|
}
|