]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
call.c (joust): Also warn about confusing conversion op/constructor overload resolution.
authorJason Merrill <jason@yorick.cygnus.com>
Fri, 5 Jun 1998 23:03:33 +0000 (23:03 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 5 Jun 1998 23:03:33 +0000 (19:03 -0400)
* call.c (joust): Also warn about confusing conversion op/constructor
overload resolution.

From-SVN: r20258

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

index 04ff5dc88eb29a57ab4bd2b2f11d24bd6dc5fa33..65a4819edbb420ec04cd604ecf62f52094a72150 100644 (file)
@@ -1,5 +1,8 @@
 1998-06-05  Jason Merrill  <jason@yorick.cygnus.com>
 
+       * call.c (joust): Also warn about confusing conversion op/constructor
+       overload resolution.
+
        * spew.c (yylex): Also return the TYPE_DECL if got_object.
        Don't clear got_object after '~'.
        * call.c (build_scoped_method_call): Tweak destructor handling.
index 7007cdf44ed2ca2fbd951f7be56e680ae426838f..cf0a21a754be44ed3b0e8acb4e119f58aff9b2f7 100644 (file)
@@ -4298,12 +4298,10 @@ joust (cand1, cand2, warn)
     }
 
   /* warn about confusing overload resolution */
-  if (winner && cand1->second_conv
-      && ! DECL_CONSTRUCTOR_P (cand1->fn)
-      && ! DECL_CONSTRUCTOR_P (cand2->fn))
+  if (winner && cand1->second_conv)
     {
       int comp = compare_ics (cand1->second_conv, cand2->second_conv);
-      if (comp && comp != winner)
+      if (comp != winner)
        {
          struct z_candidate *w, *l;
          if (winner == 1)
@@ -4316,7 +4314,7 @@ joust (cand1, cand2, warn)
              cp_warning ("  for conversion from `%T' to `%T'",
                          TREE_TYPE (source_type (TREE_VEC_ELT (w->convs, 0))),
                          TREE_TYPE (w->second_conv));
-             cp_warning ("  because conversion sequence for `this' argument is better");
+             cp_warning ("  because conversion sequence for the argument is better");
            }
          else
            add_warning (w, l);