PR c++/78898 - ICE on constructor with TTP

PR c++/42329
	* pt.c (unify): Don't look for a class template from a non-class.

From-SVN: r243890
This commit is contained in:
Jason Merrill 2016-12-22 10:19:54 -05:00 committed by Jason Merrill
parent 745b451267
commit dd809fdeca
3 changed files with 14 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2016-12-22 Jason Merrill <jason@redhat.com>
PR c++/78898
PR c++/42329
* pt.c (unify): Don't look for a class template from a non-class.
2016-12-21 Jakub Jelinek <jakub@redhat.com>
PR c++/72707

View File

@ -20292,7 +20292,8 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict,
if (TREE_CODE (parm) == BOUND_TEMPLATE_TEMPLATE_PARM)
{
if (strict_in & UNIFY_ALLOW_DERIVED)
if ((strict_in & UNIFY_ALLOW_DERIVED)
&& CLASS_TYPE_P (arg))
{
/* First try to match ARG directly. */
tree t = try_class_unification (tparms, targs, parm, arg,

View File

@ -0,0 +1,6 @@
// PR c++/78898
struct A {
template <class T> A(T);
template <template <typename> class SmartPtr> A(SmartPtr<int>) { A(0); }
};