This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: IA64 HP-UX patch for C++ (Modified)
- From: Jason Merrill <jason at redhat dot com>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: Richard Henderson <rth at redhat dot com>,Steve Ellcey <sje at cup dot hp dot com>,"gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 08 Oct 2002 10:44:08 +0100
- Subject: Re: IA64 HP-UX patch for C++ (Modified)
- References: <4160000.1034059408@localhost>
On Mon, 07 Oct 2002 23:43:28 -0700, Mark Mitchell <mark@codesourcery.com> wrote:
> --On Tuesday, October 01, 2002 10:29:48 AM +0100 Jason Merrill
> <jason@redhat.com> wrote:
>
>> Why not convert()?
>
> We don't really know what convert will do; it is a semantic routine.
> It might issue warnings, generate cross-referencing information, whatever.
> It might do conversions that we don't want, masking typos.
convert shouldn't do that; it is used by middle-end code (particularly
fold) to do conversions just like this. I used to have a bug whereby
folding a pointer adjustment would add an additional adjustment; to fix
that, I created cp_convert for frontend routines to call.
convert should just perform the conversion. It should only give an error
when a requested conversion doesn't make any sense.
> It's not that it wouldn't work; it's that it (in my opinion) it operates
> at the wrong level. The parser and semantic analysis routines should
> be using things like convert() in those situations where the language
> tells us to perform conversions. We should use the above when we are
> generating lowered code.
I disagree; the parser and semantic analysis routines should use
frontend-specific routines (i.e. implicit_conversion) for those situations.
Using build1 (NOP_EXPR) only works when the conversion is, in fact, a nop.
Jason