From 3a8face47ee8bb94a50a98a0cfb5c5fd6292e58c Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 9 Mar 2011 12:57:46 -0500 Subject: [PATCH] re PR c++/44629 (ICE in unify, at cp/pt.c:15155) PR c++/44629 * pt.c (unify): An unresolved overload is a nondeduced context. From-SVN: r170824 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/pt.c | 3 +++ gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/g++.dg/template/nontype22.C | 11 +++++++++++ 4 files changed, 23 insertions(+) create mode 100644 gcc/testsuite/g++.dg/template/nontype22.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b0adb8f7af6..789b2cf62c8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2011-03-09 Jason Merrill + + PR c++/44629 + * pt.c (unify): An unresolved overload is a nondeduced context. + 2011-03-09 Martin Jambor PR tree-optimization/47714 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 2ca2cd0c0c2..ac91698ad72 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -15688,6 +15688,9 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict) return 1; default: + /* An unresolved overload is a nondeduced context. */ + if (type_unknown_p (parm)) + return 0; gcc_assert (EXPR_P (parm)); /* We must be looking at an expression. This can happen with diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ba746dab752..0c30b083f35 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2011-03-09 Jason Merrill + + * g++.dg/template/nontype22.C: New. + 2011-03-09 Martin Jambor PR tree-optimization/47714 diff --git a/gcc/testsuite/g++.dg/template/nontype22.C b/gcc/testsuite/g++.dg/template/nontype22.C new file mode 100644 index 00000000000..f2c8c46e9fc --- /dev/null +++ b/gcc/testsuite/g++.dg/template/nontype22.C @@ -0,0 +1,11 @@ +// PR c++/44629 +// The proper mangling is unclear. + +template int cmp1(T a, T b); +template struct A { }; +template void f (A &); // { dg-bogus "" "" { xfail *-*-* } } +void g() +{ + A a; + f(a); +} -- 2.30.2