Commit d778c637 by Jason Merrill Committed by Jason Merrill

PR c++/72801 - ICE with variadic partial specialization

	* pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.

From-SVN: r249755
parent 4516a545
2017-06-28 Jason Merrill <jason@redhat.com>
PR c++/72801 - ICE with variadic partial specialization
* pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
PR c++/55639 - partial specialization with ::template
* parser.c (cp_parser_class_head): Handle ::template.
......
......@@ -20044,6 +20044,9 @@ unify_pack_expansion (tree tparms, tree targs, tree packed_parms,
tree pack, packs = NULL_TREE;
int i, start = TREE_VEC_LENGTH (packed_parms) - 1;
/* Add in any args remembered from an earlier partial instantiation. */
targs = add_to_template_args (PACK_EXPANSION_EXTRA_ARGS (parm), targs);
packed_args = expand_template_argument_pack (packed_args);
int len = TREE_VEC_LENGTH (packed_args);
......
// PR c++/72801
// { dg-do compile { target c++11 } }
template < typename, typename > struct A {};
template < typename ... T > struct B
{
template < typename > struct C
{
static const int a = 0;
};
template < typename R, typename ... S >
struct C < R (A < T, S > ...) >
{
static const int a = 1;
};
};
#define SA(X) static_assert ((X), #X)
SA(B <>::C<int()>::a == 1);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment