call.c (joust): Ensure more_specialized()'s argument length parameter has correct...
authorJeffrey Oldham <oldham@codesourcery.com>
Mon, 26 Feb 2001 15:59:30 +0000 (15:59 +0000)
committerJeffrey D. Oldham <oldham@gcc.gnu.org>
Mon, 26 Feb 2001 15:59:30 +0000 (15:59 +0000)
2001-02-26  Jeffrey Oldham  <oldham@codesourcery.com>

* call.c (joust): Ensure more_specialized()'s argument length
parameter has correct value for constructors.

From-SVN: r40068

gcc/cp/ChangeLog
gcc/cp/call.c

index ede5dc12f500cc55063c8d37945902fc853595cd..4b0b80b3ce253c7348c2435de74418383d9cd3c9 100644 (file)
@@ -1,3 +1,8 @@
+2001-02-26  Jeffrey Oldham  <oldham@codesourcery.com>
+
+       * call.c (joust): Ensure more_specialized()'s argument length
+       parameter has correct value for constructors.
+
 2001-02-26  Nathan Sidwell  <nathan@codesourcery.com>
 
        * except.c (call_eh_info): Cleanup generation of cp_eh_info struct.
index b7e6e943c6b71ff5945d1355869fb2dd2a7a7588..a9af4027f786a901a34b7b0cb8cec484416c1cc7 100644 (file)
@@ -5221,14 +5221,18 @@ joust (cand1, cand2, warn)
       winner = more_specialized
         (TI_TEMPLATE (cand1->template), TI_TEMPLATE (cand2->template),
          DEDUCE_ORDER,
-         /* Tell the deduction code how many real function arguments we saw,
-           not counting the implicit 'this' argument.
+         /* Tell the deduction code how many real function arguments
+           we saw, not counting the implicit 'this' argument.  But,
+           add_function_candidate() suppresses the "this" argument
+           for constructors.
 
            [temp.func.order]: The presence of unused ellipsis and default
            arguments has no effect on the partial ordering of function
            templates.  */
          TREE_VEC_LENGTH (cand1->convs)
-         - DECL_NONSTATIC_MEMBER_FUNCTION_P (cand1->fn));
+        - (DECL_NONSTATIC_MEMBER_FUNCTION_P (cand1->fn)
+           - DECL_CONSTRUCTOR_P (cand1->fn)));
+      /* HERE */
       if (winner)
         return winner;
     }