From: Jason Merrill Date: Fri, 5 Jun 1998 23:03:33 +0000 (+0000) Subject: call.c (joust): Also warn about confusing conversion op/constructor overload resolution. X-Git-Tag: prereleases/egcs-1.1-prerelease~902 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=598c8c2c40c276319e75e4ff7aefb4dc869baed9;p=thirdparty%2Fgcc.git call.c (joust): Also warn about confusing conversion op/constructor overload resolution. * call.c (joust): Also warn about confusing conversion op/constructor overload resolution. From-SVN: r20258 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 04ff5dc88eb2..65a4819edbb4 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 1998-06-05 Jason Merrill + * 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. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 7007cdf44ed2..cf0a21a754be 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -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);