===================================================================
@@ -13811,6 +13811,20 @@ cp_parser_template_parameter (cp_parser* parser, b
/* Consume the `...' for better error recovery. */
cp_lexer_consume_token (parser->lexer);
}
+ /* If the next token is an ellipsis, and we don't already have it
+ marked as a parameter pack, then we have a parameter pack (that
+ has no declarator). */
+ else if (!*is_parameter_pack
+ && cp_lexer_next_token_is (parser->lexer, CPP_ELLIPSIS)
+ && (declarator_can_be_parameter_pack
+ (parameter_declarator->declarator)))
+ {
+ /* Consume the `...'. */
+ cp_lexer_consume_token (parser->lexer);
+ maybe_warn_variadic_templates ();
+
+ *is_parameter_pack = true;
+ }
// The parameter may have been constrained.
if (is_constrained_parameter (parameter_declarator))
===================================================================
@@ -0,0 +1,14 @@
+// PR c++/67318
+// { dg-do compile { target c++11 } }
+
+template<signed...>
+struct MyStruct1;
+
+template<unsigned...>
+struct MyStruct2;
+
+template<short...>
+struct MyStruct3;
+
+template<long...>
+struct MyStruct4;