From d90a25424a1aee87c7b5d56545c971fa89577ee3 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 10 Jan 2018 19:54:17 +0000 Subject: [PATCH] parser.c (cp_parser_std_attribute_spec): When token_pair::require_open / require_close return false simply return... 2018-01-10 Paolo Carlini * parser.c (cp_parser_std_attribute_spec): When token_pair::require_open / require_close return false simply return error_mark_node, avoid duplicate cp_parser_error about expected '(' / ')', respectively. From-SVN: r256451 --- gcc/cp/ChangeLog | 7 +++++++ gcc/cp/parser.c | 10 ++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d24c9343620..af3711253b3 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2018-01-10 Paolo Carlini + + * parser.c (cp_parser_std_attribute_spec): When + token_pair::require_open / require_close return false simply + return error_mark_node, avoid duplicate cp_parser_error about + expected '(' / ')', respectively. + 2018-01-10 David Malcolm PR c++/43486 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index b16597ce9b7..80d65a84af0 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -25321,10 +25321,7 @@ cp_parser_std_attribute_spec (cp_parser *parser) matching_parens parens; if (!parens.require_open (parser)) - { - cp_parser_error (parser, "expected %<(%>"); - return error_mark_node; - } + return error_mark_node; cp_parser_parse_tentatively (parser); alignas_expr = cp_parser_type_id (parser); @@ -25354,10 +25351,7 @@ cp_parser_std_attribute_spec (cp_parser *parser) return error_mark_node; if (!parens.require_close (parser)) - { - cp_parser_error (parser, "expected %<)%>"); - return error_mark_node; - } + return error_mark_node; /* Build the C++-11 representation of an 'aligned' attribute. */ -- 2.30.2