P0428R2 - familiar template syntax for generic lambdas * parser.c (cp_parser_lambda_declarator_opt): Don't pedwarn for cxx2a and above, reword pedwarn for C++14/C++17. * g++.dg/cpp1y/lambda-generic-x.C: Adjust warnings and limit to c++17_down target. * g++.dg/cpp1y/lambda-generic-dep.C: Likewise. * g++.dg/cpp1y/lambda-generic-77914.C: Adjust error and limit to c++17_down target. * g++.dg/cpp2a/lambda-generic1.C: New test. * g++.dg/cpp2a/lambda-generic2.C: New test. * g++.dg/cpp2a/lambda-generic3.C: New test. * g++.dg/cpp2a/lambda-generic4.C: New test. * g++.dg/cpp2a/lambda-generic5.C: New test. From-SVN: r254991
8 lines
329 B
C
8 lines
329 B
C
// P0428R2
|
|
// { dg-do compile }
|
|
|
|
int j = []<class T>(T t, int i) { return i; }(3, 4);
|
|
// { dg-error "lambda templates are only available with" "" { target c++17_down } .-1 }
|
|
// { dg-error "lambda expressions only available with" "" { target c++98_only } .-2 }
|
|
// { dg-error "invalid use of 'auto'" "" { target c++98_only } .-3 }
|