This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH to build_conditional_expr for c++/11283
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 10 Sep 2003 22:54:10 -0700
- Subject: Re: C++ PATCH to build_conditional_expr for c++/11283
- References: <wvlsmnuekhw.fsf@prospero.boston.redhat.com>
2003-08-21 Jason Merrill <jason@redhat.com>
PR c++/11283
* call.c (build_conditional_expr): Ignore cv-qual differences
for non-class types.
> ! if (!same_type_p (TREE_TYPE (arg2), arg3_type)
> ! && CLASS_TYPE_P (arg3_type))
> ! /* The types need to match if we're converting to a class type.
> ! If not, we don't care about cv-qual mismatches, since
> ! non-class rvalues are not cv-qualified. */
A more precise fix would be:
if (CLASS_TYPE_P (arg3_type)
? same_type_p (...)
: same_type_ignoring_top_level_qualifiers_p (...))
...
That way we would still catch int vs. short, for example.
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com