This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C++ PATCH Re: Problems compiling KDE programs with GCC 3.3+
- From: Jason Merrill <jason at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, Andreas Jaeger <aj at suse dot de>
- Cc: gcc at gcc dot gnu dot org, dmuell at gmx dot net
- Date: Mon, 13 Jan 2003 01:23:51 -0500
- Subject: C++ PATCH Re: Problems compiling KDE programs with GCC 3.3+
- References: <u8k7ha2r54.fsf@gromit.moeb><m3of6m8c7c.fsf@uniton.integrable-solutions.net><u8k7ha144c.fsf@gromit.moeb>
In my earlier patch, I was forgetting that we can get an AMBIG_CONV for a
set of bad conversions, too. Test in g++.dg/overload/ambig2.C.
Tested i686-pc-linux-gnu, applied 3.3 and trunk.
2003-01-13 Jason Merrill <jason@redhat.com>
* call.c (build_user_type_conversion_1): Do set ICS_BAD_FLAG if
all the ambiguous conversions are bad.
*** call.c.~1~ Fri Jan 10 00:55:48 2003
--- call.c Sun Jan 12 23:01:26 2003
*************** build_user_type_conversion_1 (tree totyp
*** 2536,2543 ****
cand = candidates; /* any one will do */
cand->second_conv = build1 (AMBIG_CONV, totype, expr);
ICS_USER_FLAG (cand->second_conv) = 1;
! /* Don't set ICS_BAD_FLAG; an ambiguous conversion is no worse than
! another user-defined conversion. */
return cand;
}
--- 2536,2546 ----
cand = candidates; /* any one will do */
cand->second_conv = build1 (AMBIG_CONV, totype, expr);
ICS_USER_FLAG (cand->second_conv) = 1;
! if (!any_strictly_viable (candidates))
! ICS_BAD_FLAG (cand->second_conv) = 1;
! /* If there are viable candidates, don't set ICS_BAD_FLAG; an
! ambiguous conversion is no worse than another user-defined
! conversion. */
return cand;
}