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: RFC: PATCH to diagnostic.c:text_specifies_location


Neil Booth <neil at daikokuya dot co dot uk> writes:

| Gabriel Dos Reis wrote:-
| 
| > Jason Merrill <jason at redhat dot com> writes:
| > 
| > [...]
| > 
| > | The patch below causes us to ignore a location_t that specifies line 0;
| > | instead we will just use the current file and line in the error message.
| > | Do people think this is a good idea, or is it more useful to explicitly
| > | tell the user that the declaration is a builtin?  I'm actually leaning a
| > | bit towards the latter now.  The dg harness can handle messages at line 0.
| > 
| > In my opinion, <internal>:0 makes much more sense than <internal>:19.  
| > I suggest we make dg handle <internal>:0.
| 
| Might I ask why C++ needs <internal> and nothing else does?

I believe GCC built-ins have such status.

However here is a standard scenario:  C++ defines the notion of
replaceable functions. 

At the beginning of translating a unit, the compiler ought to forward
declare (internally) some replaceable functions like "operator new()"
et al.  If the program supplies a definition for such functions then
they take precedence; else the compiler picks up the ones coming with
the runtime support. 

I don't know whether other languages currently supported by GCC have
such notions.

-- Gaby


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