+2015-09-10 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/67318
+ * parser.c (cp_parser_parameter_declaration): Consume the ellipsis
+ and set template_parameter_pack_p also when the type is null.
+
2015-09-09 Mark Wielaard <mjw@redhat.com>
* typeck.c (cp_build_binary_op): Check and warn when nonnull arg
}
}
- /* If the next token is an ellipsis, and we have not seen a
- declarator name, and the type of the declarator contains parameter
- packs but it is not a TYPE_PACK_EXPANSION, then we actually have
- a parameter pack expansion expression. Otherwise, leave the
- ellipsis for a C-style variadic function. */
+ /* If the next token is an ellipsis, and we have not seen a declarator
+ name, and if either the type of the declarator contains parameter
+ packs but it is not a TYPE_PACK_EXPANSION or is null (this happens
+ for, eg, abbreviated integral type names), then we actually have a
+ parameter pack expansion expression. Otherwise, leave the ellipsis
+ for a C-style variadic function. */
token = cp_lexer_peek_token (parser->lexer);
if (cp_lexer_next_token_is (parser->lexer, CPP_ELLIPSIS))
{
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 ();