diff options
author | Dodji Seketeli <dodji@redhat.com> | 2009-04-22 19:17:18 +0000 |
---|---|---|
committer | Dodji Seketeli <dodji@gcc.gnu.org> | 2009-04-22 21:17:18 +0200 |
commit | a58f7da12a2ada0ab43e1e5a5ce2945c0b738b3c (patch) | |
tree | 87888eae1c1d62f5e323133efe34807a7c9c4ba7 /gcc/cp | |
parent | d1b382088a11a55c13fe0a9769a3c46a72836dd1 (diff) | |
download | gcc-a58f7da12a2ada0ab43e1e5a5ce2945c0b738b3c.zip gcc-a58f7da12a2ada0ab43e1e5a5ce2945c0b738b3c.tar.gz gcc-a58f7da12a2ada0ab43e1e5a5ce2945c0b738b3c.tar.bz2 |
re PR c++/39639 (no diagnostic for ill-formed pack expansion)
2009-04-22 Dodji Seketeli <dodji@redhat.com>
gcc/cp/ChangeLog:
PR c++/39639
* parser.c (cp_parser_template_argument_list): Display an error
when an ellipsis is not preceded by a parameter pack. Also, warn
about variadic templates usage without -std=c++0x.
gcc/testsuite/ChangeLog:
PR c++/39639
* g++.dg/cpp0x/pr39639.C: New test.
From-SVN: r146610
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/parser.c | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b560aa8..9f0db7b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2009-04-22 Dodji Seketeli <dodji@redhat.com> + + PR c++/39639 + * parser.c (cp_parser_template_argument_list): Display an error + when an ellipsis is not preceded by a parameter pack. Also, warn + about variadic templates usage without -std=c++0x. + 2009-04-21 Taras Glek <tglek@mozilla.com> * cp-tree.h: Update GTY annotations to new syntax. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 806d6f9..d98cfdd 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -10470,6 +10470,12 @@ cp_parser_template_argument_list (cp_parser* parser) argument pack. */ if (cp_lexer_next_token_is (parser->lexer, CPP_ELLIPSIS)) { + if (argument == error_mark_node) + { + cp_token *token = cp_lexer_peek_token (parser->lexer); + error ("%Hexpected parameter pack before %<...%>", + &token->location); + } /* Consume the `...' token. */ cp_lexer_consume_token (parser->lexer); |