Commit 71b3723a by Jason Merrill Committed by Jason Merrill

PR c++/70778 - member template template parameter

	* pt.c (tsubst): Also substitute into the template of a
	BOUND_TEMPLATE_TEMPLATE_PARM.

From-SVN: r238686
parent 6970223f
2016-07-23 Jason Merrill <jason@redhat.com>
PR c++/70778
* pt.c (tsubst): Also substitute into the template of a
BOUND_TEMPLATE_TEMPLATE_PARM.
PR c++/71738
* pt.c (lookup_template_class_1): Handle getting template from tsubst.
......
......@@ -13232,13 +13232,20 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
if (code == BOUND_TEMPLATE_TEMPLATE_PARM)
{
tree argvec = tsubst (TYPE_TI_ARGS (t), args,
tree tinfo = TYPE_TEMPLATE_INFO (t);
/* We might need to substitute into the types of non-type
template parameters. */
tree tmpl = tsubst (TI_TEMPLATE (tinfo), args,
complain, in_decl);
if (tmpl == error_mark_node)
return error_mark_node;
tree argvec = tsubst (TI_ARGS (tinfo), args,
complain, in_decl);
if (argvec == error_mark_node)
return error_mark_node;
TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (r)
= build_template_info (TYPE_TI_TEMPLATE (t), argvec);
= build_template_info (tmpl, argvec);
}
}
break;
......
// PR c++/70778
template <class KeyType>
struct Stuff
{
template <KeyType, class>
struct AddToFront;
template <KeyType ToAdd, template<KeyType> class Holder, KeyType Indexs>
struct AddToFront<ToAdd, Holder<Indexs> >
{
};
};
template <unsigned>
struct Holder {};
int main()
{
Stuff<unsigned>::AddToFront<0, Holder<24> > t;
}
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