On Fri, Jul 10, 2020 at 11:43:59AM -0400, Marek Polacek via Gcc-patches wrote:
> diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
> index 528b41b7170..ee6a956aea9 100644
> --- a/gcc/cp/parser.c
> +++ b/gcc/cp/parser.c
> @@ -19412,7 +19412,12 @@ cp_parser_enum_specifier (cp_parser* parser)
>                    "ISO C++ forbids empty unnamed enum");
>       }
>        else
> -     cp_parser_enumerator_list (parser, type);
> +     {
> +       /* We've seen a '}' so we know we're in an enum-specifier.

Shouldn't that be '{' instead?

> +          Commit to any tentative parse to get syntax errors.  */
> +       cp_parser_commit_to_tentative_parse (parser);
> +       cp_parser_enumerator_list (parser, type);
> +     }

        Jakub

Reply via email to