pt.c (more_specialized): Don't optimize len==0.
authorJason Merrill <jason@gcc.gnu.org>
Sat, 23 Dec 2000 00:05:44 +0000 (19:05 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Sat, 23 Dec 2000 00:05:44 +0000 (19:05 -0500)
        * pt.c (more_specialized): Don't optimize len==0.
        (fn_type_unification): If we're adding the return type, increase len.

From-SVN: r38472

gcc/cp/pt.c

index 0a260dfcb79f9a65d1419448ca0bbefaa8b9b1f4..0c4991a1a50763f9c525df552f2a607966799d46 100644 (file)
@@ -7666,6 +7666,8 @@ fn_type_unification (fn, explicit_targs, targs, args, return_type,
       /* We've been given a return type to match, prepend it.  */
       parms = tree_cons (NULL_TREE, TREE_TYPE (fntype), parms);
       args = tree_cons (NULL_TREE, return_type, args);
+      if (len >= 0)
+       ++len;
     }
 
   /* We allow incomplete unification without an error message here
@@ -8875,9 +8877,6 @@ more_specialized (pat1, pat2, len)
   tree targs;
   int winner = 0;
 
-  if (len == 0)
-    return 0;
-
   targs = get_bindings_order (pat1, DECL_TEMPLATE_RESULT (pat2), len);
   if (targs)
     --winner;