This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
(C++) patch to instantiate_type
- To: egcs-patches at cygnus dot com
- Subject: (C++) patch to instantiate_type
- From: Jason Merrill <jason at cygnus dot com>
- Date: Wed, 28 Oct 1998 21:02:21 -0800
Fixes g++.pt/overload5.C.
1998-10-28 Jason Merrill <jason@yorick.cygnus.com>
* class.c (instantiate_type): Don't consider templates for a normal
match.
Index: class.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/class.c,v
retrieving revision 1.102
diff -c -p -r1.102 class.c
*** class.c 1998/10/28 20:29:04 1.102
--- class.c 1998/10/29 05:01:47
*************** instantiate_type (lhstype, rhs, complain
*** 5140,5146 ****
else for (elems = rhs; elems; elems = OVL_CHAIN (elems))
{
elem = OVL_FUNCTION (elems);
! if (comptypes (lhstype, TREE_TYPE (elem), 1))
{
mark_used (elem);
return elem;
--- 5140,5147 ----
else for (elems = rhs; elems; elems = OVL_CHAIN (elems))
{
elem = OVL_FUNCTION (elems);
! if (TREE_CODE (elem) == FUNCTION_DECL
! && comptypes (lhstype, TREE_TYPE (elem), 1))
{
mark_used (elem);
return elem;
*************** instantiate_type (lhstype, rhs, complain
*** 5195,5201 ****
for (elems = rhs; elems; elems = OVL_NEXT (elems))
{
elem = OVL_CURRENT (elems);
! if (comp_target_types (lhstype, TREE_TYPE (elem), 1) > 0)
break;
}
if (elems)
--- 5196,5203 ----
for (elems = rhs; elems; elems = OVL_NEXT (elems))
{
elem = OVL_CURRENT (elems);
! if (TREE_CODE (elem) == FUNCTION_DECL
! && comp_target_types (lhstype, TREE_TYPE (elem), 1) > 0)
break;
}
if (elems)
*************** instantiate_type (lhstype, rhs, complain
*** 5205,5211 ****
elems = OVL_CHAIN (elems))
{
elem = OVL_FUNCTION (elems);
! if (comp_target_types (lhstype, TREE_TYPE (elem), 0) > 0)
break;
}
if (elems)
--- 5207,5214 ----
elems = OVL_CHAIN (elems))
{
elem = OVL_FUNCTION (elems);
! if (TREE_CODE (elem) == FUNCTION_DECL
! && comp_target_types (lhstype, TREE_TYPE (elem), 0) >0)
break;
}
if (elems)