diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c01ed9f159e..cd6c0d7724b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2000-07-05 Jason Merrill + + * call.c (joust): Don't complain about `operator char *()' beating + `operator const char *() const'. + 2000-07-04 scott snyder Jason Merrill diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 1dd6a291a6a..48ce6fb76a9 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -5050,11 +5050,21 @@ joust (cand1, cand2, warn) if (comp != winner) { struct z_candidate *w, *l; + tree convn; if (winner == 1) w = cand1, l = cand2; else w = cand2, l = cand1; - if (warn) + if (DECL_CONTEXT (cand1->fn) == DECL_CONTEXT (cand2->fn) + && ! DECL_CONSTRUCTOR_P (cand1->fn) + && ! DECL_CONSTRUCTOR_P (cand2->fn) + && (convn = standard_conversion + (TREE_TYPE (TREE_TYPE (l->fn)), + TREE_TYPE (TREE_TYPE (w->fn)), NULL_TREE)) + && TREE_CODE (convn) == QUAL_CONV) + /* Don't complain about `operator char *()' beating + `operator const char *() const'. */; + else if (warn) { tree source = source_type (TREE_VEC_ELT (w->convs, 0)); if (! DECL_CONSTRUCTOR_P (w->fn))