On Wed, Jul 18, 2018 at 4:57 AM, Jakub Jelinek <ja...@redhat.com> wrote: > The standard says: > "In the decl-specifier-seq of the lambda-declarator, each decl-specifier shall > either be mutable or constexpr." > and the C++ FE has CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR flag for that. > But as implemented, it is actually > CP_PARSER_FLAGS_ONLY_TYPE_OR_MUTABLE_OR_CONSTEXPR > as it allows mutable, constexpr and type specifiers. > > Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for > trunk? > > 2018-07-17 Jakub Jelinek <ja...@redhat.com> > > PR c++/86550 > * parser.c (cp_parser_decl_specifier_seq): Don't parse a type > specifier > if CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR.
I think the diagnostic would be better if we parse the type-specifier and then give an error about it being invalid in this context, rather than not parse it and therefore give a syntax error; the constraint is semantic rather than syntactic. Jason