public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/4707: g++ complains about a "typedef", but no typedefs are there
@ 2001-10-27 4:46 lerdsuwa
0 siblings, 0 replies; 3+ messages in thread
From: lerdsuwa @ 2001-10-27 4:46 UTC (permalink / raw)
To: dlux, gcc-bugs, gcc-prs, nobody
Synopsis: g++ complains about a "typedef", but no typedefs are there
State-Changed-From-To: open->analyzed
State-Changed-By: lerdsuwa
State-Changed-When: Sat Oct 27 04:45:59 2001
State-Changed-Why:
Confirm as a bug.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=4707&database=gcc
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: c++/4707: g++ complains about a "typedef", but no typedefs are there
@ 2002-12-04 6:26 Wolfgang Bangerth
0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Bangerth @ 2002-12-04 6:26 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/4707; it has been noted by GNATS.
From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: gcc-gnats@gcc.gnu.org, Volker Reichelt <reichelt@igpm.rwth-aachen.de>,
<dlux@dlux.dlux.hu>
Cc:
Subject: Re: c++/4707: g++ complains about a "typedef", but no typedefs are
there
Date: Wed, 4 Dec 2002 08:21:49 -0600 (CST)
The real error of course is the lack of a semicolon after the struct
declaration. This brings the typedef into the trouble with the class. If I
add the semicolon, I get a much more reasonable message:
tmp/g> /home/bangerth/bin/gcc-3.3-pre/bin/c++ -c x.cc
x.cc: In member function `void A<T>::foo()':
x.cc:3: error: parse error before `;' token
W.
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth@ticam.utexas.edu
www: http://www.ticam.utexas.edu/~bangerth
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: c++/4707: g++ complains about a "typedef", but no typedefs are there
@ 2002-12-04 2:26 Volker Reichelt
0 siblings, 0 replies; 3+ messages in thread
From: Volker Reichelt @ 2002-12-04 2:26 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/4707; it has been noted by GNATS.
From: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
To: gcc-gnats@gcc.gnu.org, dlux@dlux.dlux.hu, gcc-bugs@gcc.gnu.org,
nobody@gcc.gnu.org
Cc:
Subject: Re: c++/4707: g++ complains about a "typedef", but no typedefs are there
Date: Wed, 4 Dec 2002 12:12:14 +0100
The problem can be demonstrated with the following (illegal) code snippet:
--------------------------snip here-----------------------------
template <class T> struct A
{
void foo() { bar(T); }
void bar();
}
typedef int INT;
--------------------------snip here-----------------------------
With mainline I get the following error message:
PR4707.cc: In member function `void A<T>::foo()':
PR4707.cc:3: error: parse error before `typedef'
PR4707.cc: At global scope:
PR4707.cc:7: error: extraneous `int' ignored
PR4707.cc:7: error: template declaration of `typedef struct A<T> INT'
There are two things correct about the error message:
* The bug is in the member function `void A<T>::foo()'.
* It is in line 3 (you cannot use the template parameter T like this).
The rest is bogus:
* The parse error happens before ")" and not before the "typedef"
which comes after the end of the whole struct. You can actually
place as many members between "foo" and the end of the struct as you
want - the parser complains about the typedef.
* The last three lines of the error message are nonsense.
Hopefully, this gets fixed with the new parser.
Regards,
Volker
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4707
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-12-04 14:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-27 4:46 c++/4707: g++ complains about a "typedef", but no typedefs are there lerdsuwa
2002-12-04 2:26 Volker Reichelt
2002-12-04 6:26 Wolfgang 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).