diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-09-20 17:16:55 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-09-20 17:16:55 +0200 |
commit | 590b62e90d6d86e68442ffa608c7c6e5653736d5 (patch) | |
tree | 229e839167623726277acaa76b17ab8cf5af96ab /gcc/cp/parser.c | |
parent | 377f30c00f3b8b8b0da748dbb9d988fa67a8ec2f (diff) | |
download | gcc-590b62e90d6d86e68442ffa608c7c6e5653736d5.zip gcc-590b62e90d6d86e68442ffa608c7c6e5653736d5.tar.gz gcc-590b62e90d6d86e68442ffa608c7c6e5653736d5.tar.bz2 |
re PR c++/77637 (ICE on x86_64-linux-gnu (Segmentation fault, tree_check, cp_parser_std_attribute_list...))
PR c++/77637
* parser.c (cp_parser_std_attribute_list): Reject ... without
preceding attribute.
* g++.dg/cpp0x/gen-attrs-62.C: New test.
From-SVN: r240265
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index c03b9c2..9a20a5f 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -24221,8 +24221,12 @@ cp_parser_std_attribute_list (cp_parser *parser, tree attr_ns) if (token->type == CPP_ELLIPSIS) { cp_lexer_consume_token (parser->lexer); - TREE_VALUE (attribute) - = make_pack_expansion (TREE_VALUE (attribute)); + if (attribute == NULL_TREE) + error_at (token->location, + "expected attribute before %<...%>"); + else + TREE_VALUE (attribute) + = make_pack_expansion (TREE_VALUE (attribute)); token = cp_lexer_peek_token (parser->lexer); } if (token->type != CPP_COMMA) |