From: Nathan Sidwell Date: Sat, 28 Jun 2003 13:48:53 +0000 (+0000) Subject: re PR c++/10784 (Warning about choosing custom operator over copy constructor cannot... X-Git-Tag: releases/gcc-3.4.0~5374 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2e2d40751c26880f61cc44d1e91a84e7083a64eb;p=thirdparty%2Fgcc.git re PR c++/10784 (Warning about choosing custom operator over copy constructor cannot be turned off (and it's useless in the first place)) PR c++/10784 * call.c (joust): Move warn_conversion check outwards. From-SVN: r68639 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3e878d8a1f93..41ed2699640f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2003-06-28 Nathan Sidwell + + PR c++/10784 + * call.c (joust): Move warn_conversion check outwards. + 2003-06-27 Zack Weinberg * decl.c (build_typename_type) diff --git a/gcc/cp/call.c b/gcc/cp/call.c index ddc6b4b86097..d92a24e699a1 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -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))