===================================================================
@@ -19626,11 +19626,12 @@ cp_parser_parameter_declaration (cp_parser *parser
if (type && DECL_P (type))
type = TREE_TYPE (type);
- if (type
- && TREE_CODE (type) != TYPE_PACK_EXPANSION
- && declarator_can_be_parameter_pack (declarator)
- && (template_parm_p || uses_parameter_packs (type)))
- {
+ if (((type
+ && TREE_CODE (type) != TYPE_PACK_EXPANSION
+ && (template_parm_p || uses_parameter_packs (type)))
+ || (!type && template_parm_p))
+ && declarator_can_be_parameter_pack (declarator))
+ {
/* Consume the `...'. */
cp_lexer_consume_token (parser->lexer);
maybe_warn_variadic_templates ();
===================================================================
@@ -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;