public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/10244: [3.4 regression] In error messages for templates, template type is no longer displayed
@ 2003-04-29 20:46 reichelt
0 siblings, 0 replies; 2+ messages in thread
From: reichelt @ 2003-04-29 20:46 UTC (permalink / raw)
To: bangerth, gcc-bugs, gcc-prs, nobody
Synopsis: [3.4 regression] In error messages for templates, template type is no longer displayed
State-Changed-From-To: open->closed
State-Changed-By: reichelt
State-Changed-When: Tue Apr 29 20:46:04 2003
State-Changed-Why:
Not a bug, IMHO.
It's a consequence of improved two-stage name-lookup.
Since BOGUS is not a dependant name, the parser can see that this is a bug,
while parsing the template (a not while instantiating it). As you can see,
not only the "[with T = int]" is missing, but also the
"compiler_bug.cc:9: instantiated from here" line. There is in fact no
value for T when the error message is issued.
On the other hand, if I change the code to
------------------------------------------
template <class T> void f(T) { T::BOGUS; }
int main() { f (1); }
------------------------------------------
the compiler has to wait for the instantiation to be able to see that
BOGUS is really bogus. In this case I get:
bogus.cc: In function `void f(T) [with T = int]':
bogus.cc:2: instantiated from here
bogus.cc:1: error: `int' is not an aggregate type
which does make sense to me.
Regards,
Volker
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10244
^ permalink raw reply [flat|nested] 2+ messages in thread
* c++/10244: [3.4 regression] In error messages for templates, template type is no longer displayed
@ 2003-03-27 17:06 bangerth
0 siblings, 0 replies; 2+ messages in thread
From: bangerth @ 2003-03-27 17:06 UTC (permalink / raw)
To: gcc-gnats
>Number: 10244
>Category: c++
>Synopsis: [3.4 regression] In error messages for templates, template type is no longer displayed
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Mar 27 15:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Wolfgang Bangerth
>Release: unknown-1.0
>Organization:
>Environment:
present mainline
>Description:
For a code like this:
--------------------------
template <class T> void f(T) { BOGUS; }
int main() { f (1); }
--------------------------
we would previously get an error message that states
the type of T:
g/x> /home/bangerth/bin/gcc-3.3-pre/bin/c++ -c compiler_bug.cc
compiler_bug.cc: In function `void f(T) [with T = int]':
compiler_bug.cc:9: instantiated from here
compiler_bug.cc:4: error: `BOGUS' undeclared (first use this function)
compiler_bug.cc:4: error: (Each undeclared identifier is reported only once for
each function it appears in.)
With present mainline, this "[with T=int]" is missing:
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c compiler_bug.cc
compiler_bug.cc: In function `void f(T)':
compiler_bug.cc:4: error: `BOGUS' has not been declared
I think this makes finding errors harder to find, and
consider this a regression.
W.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-04-29 20:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-29 20:46 c++/10244: [3.4 regression] In error messages for templates, template type is no longer displayed reichelt
-- strict thread matches above, loose matches on Subject: below --
2003-03-27 17:06 bangerth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).