]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/10784 (Warning about choosing custom operator over copy constructor cannot...
authorNathan Sidwell <nathan@codesourcery.com>
Sat, 28 Jun 2003 13:48:53 +0000 (13:48 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Sat, 28 Jun 2003 13:48:53 +0000 (13:48 +0000)
PR c++/10784
* call.c (joust): Move warn_conversion check outwards.

From-SVN: r68639

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

index 3e878d8a1f93fedeae808709c3f4c643fe7eedbe..41ed2699640f9d745e12f872c87e1d05a77c447b 100644 (file)
@@ -1,3 +1,8 @@
+2003-06-28  Nathan Sidwell  <nathan@codesourcery.com>
+
+       PR c++/10784
+       * call.c (joust): Move warn_conversion check outwards.
+
 2003-06-27  Zack Weinberg  <zack@codesourcery.com>
 
        * decl.c (build_typename_type)
index ddc6b4b86097ea0aa6510f61e499157c914b7407..d92a24e699a18bd7591ddbfd98c89dad67fe9393 100644 (file)
@@ -5782,7 +5782,7 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn)
   /* warn about confusing overload resolution for user-defined conversions,
      either between a constructor and a conversion op, or between two
      conversion ops.  */
-  if (winner && cand1->second_conv
+  if (winner && warn_conversion && cand1->second_conv
       && (!DECL_CONSTRUCTOR_P (cand1->fn) || !DECL_CONSTRUCTOR_P (cand2->fn))
       && winner != compare_ics (cand1->second_conv, cand2->second_conv))
     {
@@ -5816,7 +5816,7 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn)
       
       if (!give_warning)
        /*NOP*/;
-      else if (warn && warn_conversion)
+      else if (warn)
        {
          tree source = source_type (TREE_VEC_ELT (w->convs, 0));
          if (! DECL_CONSTRUCTOR_P (w->fn))