8sa1-gcc/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-86550.C
Jakub Jelinek a171a8bb39 re PR c++/86550 (Lambda parsing allows arbitrary types in decl-specifier-seq)
PR c++/86550
	* parser.c (cp_parser_decl_specifier_seq): Diagnose invalid type
	specifier if CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR.

	* g++.dg/cpp0x/lambda/lambda-86550.C: New test.

From-SVN: r262862
2018-07-18 23:01:54 +02:00

10 lines
244 B
C

// PR c++/86550
// { dg-do compile { target c++11 } }
void
foo ()
{
auto a = []() bool {}; // { dg-error "type-specifier invalid in lambda" }
auto b = []() bool bool bool bool int {}; // { dg-error "type-specifier invalid in lambda" }
}