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: r146608
+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-13 Jason Merrill <jason@redhat.com>
PR c++/39480
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);
+2009-04-22 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/39639
+ * g++.dg/cpp0x/pr39639.C: New test.
+
2009-04-22 Richard Guenther <rguenther@suse.de>
Backport from mainline:
--- /dev/null
+// Contributed by Dodji Seketeli <dodji@redhat.com>
+// Origin: PR c++/39639
+// { dg-options "-std=c++0x" }
+// { dg-do "compile" }
+
+template <class... Types>
+struct S
+ : S<...Types>, // { dg-error "expected parameter pack before '...'" }
+ S<...Types...>, // { dg-error "expected parameter pack before '...'" }
+ S<...> // { dg-error "expected parameter pack before '...'" }
+{
+ static int f () { return 1;}
+};
+
+int
+main ()
+{
+ return S<void>::f ();
+}
+