This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: IA64 HP-UX patch for C++ (Modified)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]