Commit 25abc0a5 by Gabriel Dos Reis Committed by Gabriel Dos Reis

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))

cp/
        PR c++/10784
        * call.c (joust): Warn about choosing conversion sequence only if
        -Wconversion.

testsuite/
        * g++.old-deja/g++.benjamin/16077.C: Add -Wconversion option.
        * g++.old-deja/g++.other/conv7.C: Likewise
        * g++.old-deja/g++.other/overcnv2.C: Likewise.
        * g++.old-deja/g++.other/overload14.C: Likewise.

From-SVN: r68312
parent cff5cdc8
2003-06-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
PR c++/10784
* call.c (joust): Warn about choosing conversion sequence only if
-Wconversion.
2003-06-21 Gabriel Dos Reis <gdr@integrable-solutions.net> 2003-06-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
PC c++/10864 PR c++/10864
* call.c (op_error): Tidy. * call.c (op_error): Tidy.
* error.c (dump_expr): Properly format 'T()' when T is an * error.c (dump_expr): Properly format 'T()' when T is an
aggregate type. aggregate type.
......
...@@ -5807,7 +5807,7 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) ...@@ -5807,7 +5807,7 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn)
if (!give_warning) if (!give_warning)
/*NOP*/; /*NOP*/;
else if (warn) else if (warn && warn_conversion)
{ {
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))
......
2003-06-21 Gabriel Dos Reis <gdr@integrable-solutions.net> 2003-06-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
* g++.old-deja/g++.benjamin/16077.C: Add -Wconversion option.
* g++.old-deja/g++.other/conv7.C: Likewise
* g++.old-deja/g++.other/overcnv2.C: Likewise.
* g++.old-deja/g++.other/overload14.C: Likewise.
2003-06-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
* g++.old-deja/g++.jason/conversion5.C: Adjust option. * g++.old-deja/g++.jason/conversion5.C: Adjust option.
* g++.old-deja/g++.bugs/900215_01.C: Likewise. * g++.old-deja/g++.bugs/900215_01.C: Likewise.
......
// { dg-do assemble } // { dg-do assemble }
// 981203 bkoz // 981203 bkoz
// g++/16077 // g++/16077
// { dg-options "-Wconversion" }
class nicaragua; class nicaragua;
struct colombia { struct colombia {
......
// { dg-do assemble } // { dg-do assemble }
// { dg-options "-Wconversion" }
// //
// Copyright (C) 2001 Free Software Foundation, Inc. // Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 5 May 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 5 May 2001 <nathan@codesourcery.com>
......
// { dg-do assemble } // { dg-do assemble }
// { dg-options "-Wconversion" }
// Test that we resolve this case as mandated by the standard, but also // Test that we resolve this case as mandated by the standard, but also
// warn about it. We choose op char* not because it is a member of B -- // warn about it. We choose op char* not because it is a member of B --
// the standard says that all conversion ops are treated as coming from // the standard says that all conversion ops are treated as coming from
......
// { dg-do run } // { dg-do run }
// { dg-options "-Wconversion" }
extern "C" void abort(); extern "C" void abort();
struct A { struct A {
......
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