aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2003-06-28 13:48:53 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2003-06-28 13:48:53 +0000
commit2e2d40751c26880f61cc44d1e91a84e7083a64eb (patch)
tree05f895a134d449d1d7c92cc951fb76022ebdee3d /gcc
parentc707a408ca647b98b599cd775b8c66689f3fd04c (diff)
downloadgcc-2e2d40751c26880f61cc44d1e91a84e7083a64eb.zip
gcc-2e2d40751c26880f61cc44d1e91a84e7083a64eb.tar.gz
gcc-2e2d40751c26880f61cc44d1e91a84e7083a64eb.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/call.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 3e878d8..41ed269 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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)
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index ddc6b4b..d92a24e 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))