pt.c (unify, [...]): Pass down 'strict' rather than UNIFY_ALLOW_NONE.
authorJason Merrill <jason@yorick.cygnus.com>
Sun, 29 Nov 1998 15:30:30 +0000 (15:30 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Sun, 29 Nov 1998 15:30:30 +0000 (10:30 -0500)
* pt.c (unify, case OFFSET_TYPE): Pass down 'strict' rather than
UNIFY_ALLOW_NONE.
(convert_nontype_argument): Use TYPE_PTRMEMFUNC_FN_TYPE.
(resolve_overloaded_unification): Strip baselinks.
Fixes Sec14/10_2/P14264.C, Sec14/10_2/P14278.C, Sec14/10_2/C14413.cm.

From-SVN: r23980

gcc/cp/ChangeLog
gcc/cp/pt.c

index ec88e46c4ab03ef6c57976b7b34a64cf78b549ea..2ec4103d885129783fb98b80c30cd596ad6a5dd8 100644 (file)
@@ -1,3 +1,10 @@
+1998-11-29  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * pt.c (unify, case OFFSET_TYPE): Pass down 'strict' rather than
+       UNIFY_ALLOW_NONE.
+       (convert_nontype_argument): Use TYPE_PTRMEMFUNC_FN_TYPE.
+       (resolve_overloaded_unification): Strip baselinks.
+
 Fri Nov 27 13:07:23 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * g++spec.c: Don't prototype xmalloc.
index c8ecd4599b3d24347fd7c03a90b5c7c372025331..948c53e0c4f0a3e87cf67c63b343bc2a60a5adbf 100644 (file)
@@ -2737,7 +2737,7 @@ convert_nontype_argument (type, expr)
 
        fns = TREE_OPERAND (expr, 0);
        
-       fn = instantiate_type (TREE_TYPE (TREE_TYPE (type)), 
+       fn = instantiate_type (TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (type)),
                               fns, 0);
        
        if (fn == error_mark_node)
@@ -7151,6 +7151,11 @@ resolve_overloaded_unification (tparms, targs, parm, arg, strict,
 
   if (TREE_CODE (arg) == ADDR_EXPR)
     arg = TREE_OPERAND (arg, 0);
+
+  /* Strip baselink information.  */
+  while (TREE_CODE (arg) == TREE_LIST)
+    arg = TREE_VALUE (arg);
+
   if (TREE_CODE (arg) == TEMPLATE_ID_EXPR)
     {
       /* If we got some explicit template args, we need to plug them into
@@ -7711,7 +7716,7 @@ unify (tparms, targs, parm, arg, strict, explicit_mask)
                 TYPE_OFFSET_BASETYPE (arg), UNIFY_ALLOW_NONE, explicit_mask))
        return 1;
       return unify (tparms, targs, TREE_TYPE (parm), TREE_TYPE (arg),
-                   UNIFY_ALLOW_NONE, explicit_mask);
+                   strict, explicit_mask);
 
     case CONST_DECL:
       if (arg != decl_constant_value (parm))