aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2018-01-10 19:54:17 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2018-01-10 19:54:17 +0000
commitd90a25424a1aee87c7b5d56545c971fa89577ee3 (patch)
tree4ae64a2f282e9523ec2c33d5358107e0bfd69376
parentbbb31a1d5c53076fec251945ae5a500a3e973275 (diff)
downloadgcc-d90a25424a1aee87c7b5d56545c971fa89577ee3.zip
gcc-d90a25424a1aee87c7b5d56545c971fa89577ee3.tar.gz
gcc-d90a25424a1aee87c7b5d56545c971fa89577ee3.tar.bz2
parser.c (cp_parser_std_attribute_spec): When token_pair::require_open / require_close return false simply return...
2018-01-10 Paolo Carlini <paolo.carlini@oracle.com> * 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
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/parser.c10
2 files changed, 9 insertions, 8 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d24c934..af37112 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2018-01-10 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * 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 <dmalcolm@redhat.com>
PR c++/43486
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index b16597c..80d65a8 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. */