Commit 2e2d4075 by Nathan Sidwell Committed by Nathan Sidwell

re PR c++/10784 (Warning about choosing custom operator over copy constructor…

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
parent c707a408
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> 2003-06-27 Zack Weinberg <zack@codesourcery.com>
* decl.c (build_typename_type) * decl.c (build_typename_type)
......
...@@ -5782,7 +5782,7 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) ...@@ -5782,7 +5782,7 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn)
/* warn about confusing overload resolution for user-defined conversions, /* warn about confusing overload resolution for user-defined conversions,
either between a constructor and a conversion op, or between two either between a constructor and a conversion op, or between two
conversion ops. */ conversion ops. */
if (winner && cand1->second_conv if (winner && warn_conversion && cand1->second_conv
&& (!DECL_CONSTRUCTOR_P (cand1->fn) || !DECL_CONSTRUCTOR_P (cand2->fn)) && (!DECL_CONSTRUCTOR_P (cand1->fn) || !DECL_CONSTRUCTOR_P (cand2->fn))
&& winner != compare_ics (cand1->second_conv, cand2->second_conv)) && winner != compare_ics (cand1->second_conv, cand2->second_conv))
{ {
...@@ -5816,7 +5816,7 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) ...@@ -5816,7 +5816,7 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn)
if (!give_warning) if (!give_warning)
/*NOP*/; /*NOP*/;
else if (warn && warn_conversion) else if (warn)
{ {
tree source = source_type (TREE_VEC_ELT (w->convs, 0)); tree source = source_type (TREE_VEC_ELT (w->convs, 0));
if (! DECL_CONSTRUCTOR_P (w->fn)) if (! DECL_CONSTRUCTOR_P (w->fn))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment