This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/4707] g++ complains about a "typedef", but no typedefs are there
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Aug 2003 15:28:06 -0000
- Subject: [Bug c++/4707] g++ complains about a "typedef", but no typedefs are there
- References: <20011026153600.4707.dlux@spam.dlux.hu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4707
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
------- Additional Comments From bangerth at dealii dot org 2003-08-25 15:28 -------
I think the messages are about the best the compiler can do. To explain where they
come from, remember that a typedef can not only have the form
typedef int INT;
but also this abomination:
int typedef INT;
Now, with a structure, this is legal:
struct A { int i; } typedef INT;
The problem comes here: in the reduced testcase, we have a template, not a structure,
which cannot be typedef'd. Furthernore, since the compiler sees the infix-form of the
typedef (rather than the usual prefix form), the only thing that can come after the "typedef"
can be a single name, so that's where the "extraneous `int' ignored" comes from.
Given this strange form of the typedef declaration, I think the compiler can do not better
than what it is presently giving, so I close the report.
W.