diff options
author | Jason Merrill <jason@yorick.cygnus.com> | 1998-06-05 23:03:33 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1998-06-05 19:03:33 -0400 |
commit | 598c8c2c40c276319e75e4ff7aefb4dc869baed9 (patch) | |
tree | 7c4ecda3d785bc68b7403aea9e747626a2e81718 | |
parent | 1dd6b205d683964b2e77e11e3fd5e5f58a255083 (diff) | |
download | gcc-598c8c2c40c276319e75e4ff7aefb4dc869baed9.zip gcc-598c8c2c40c276319e75e4ff7aefb4dc869baed9.tar.gz gcc-598c8c2c40c276319e75e4ff7aefb4dc869baed9.tar.bz2 |
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
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/call.c | 8 |
2 files changed, 6 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 04ff5dc..65a4819 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 7007cdf..cf0a21a 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); |