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
9 lines
367 B
C
9 lines
367 B
C
// P0428R2
|
|
// { dg-do compile }
|
|
// { dg-options "-Wno-pedantic" }
|
|
|
|
int j = []<class T>(T t, int i) { return i; }(3, 4);
|
|
// { dg-warning "lambda templates are only available with" "" { target c++11_down } .-1 }
|
|
// { dg-warning "lambda expressions only available with" "" { target c++98_only } .-2 }
|
|
// { dg-error "invalid use of 'auto'" "" { target c++98_only } .-3 }
|