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 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/86550
+ * parser.c (cp_parser_decl_specifier_seq): Diagnose invalid type
+ specifier if CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR.
+
2018-07-18 Marek Polacek <polacek@redhat.com>
PR c++/86190 - bogus -Wsign-conversion warning
found_decl_spec = true;
if (!is_cv_qualifier)
decl_specs->any_type_specifiers_p = true;
+
+ if ((flags & CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR) != 0)
+ error_at (token->location, "type-specifier invalid in lambda");
}
}
+2018-07-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/86550
+ * g++.dg/cpp0x/lambda/lambda-86550.C: New test.
+
2018-07-18 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR 69558
--- /dev/null
+// 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" }
+}