8sa1-gcc/gcc/testsuite/g++.dg/cpp2a/lambda-generic3.C
Jakub Jelinek 7768f20b0a P0428R2 - familiar template syntax for generic lambdas
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
2017-11-21 09:39:57 +01:00

9 lines
364 B
C

// P0428R2
// { dg-do compile }
// { dg-options "-Wpedantic" }
int j = []<class T>(T t, int i) { return i; }(3, 4);
// { dg-warning "lambda templates are only available with" "" { target c++17_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 }