Commit d67b5d8d by Jason Merrill Committed by Jason Merrill

PR c++/84355 - ICE with deduction for member class template.

	* pt.c (tsubst) [TEMPLATE_TYPE_PARM]: Always substitute into
	CLASS_PLACEHOLDER_TEMPLATE.

From-SVN: r258451
parent a7fea88f
2018-03-12 Jason Merrill <jason@redhat.com> 2018-03-12 Jason Merrill <jason@redhat.com>
PR c++/84355 - ICE with deduction for member class template.
* pt.c (tsubst) [TEMPLATE_TYPE_PARM]: Always substitute into
CLASS_PLACEHOLDER_TEMPLATE.
PR c++/84802 - ICE capturing uninstantiated class. PR c++/84802 - ICE capturing uninstantiated class.
* lambda.c (build_capture_proxy): Call complete_type. * lambda.c (build_capture_proxy): Call complete_type.
......
...@@ -14125,8 +14125,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl) ...@@ -14125,8 +14125,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
= tsubst_constraint (constr, args, complain, in_decl); = tsubst_constraint (constr, args, complain, in_decl);
else if (tree pl = CLASS_PLACEHOLDER_TEMPLATE (t)) else if (tree pl = CLASS_PLACEHOLDER_TEMPLATE (t))
{ {
if (DECL_TEMPLATE_TEMPLATE_PARM_P (pl)) pl = tsubst_copy (pl, args, complain, in_decl);
pl = tsubst (pl, args, complain, in_decl);
CLASS_PLACEHOLDER_TEMPLATE (r) = pl; CLASS_PLACEHOLDER_TEMPLATE (r) = pl;
} }
} }
......
// PR c++/84355
// { dg-additional-options -std=c++17 }
template <class, class> struct same;
template <class T> struct same<T,T> {};
template<typename T> struct A
{
template<class U> struct B
{
B(U);
};
A() {
B b(0);
same<decltype(b),B<int>>{};
}
};
struct C {};
A<C> a;
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