This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25497] faults typedef redefinition in struct
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Dec 2005 22:45:48 -0000
- Subject: [Bug c++/25497] faults typedef redefinition in struct
- References: <bug-25497-11901@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from gdr at integrable-solutions dot net 2005-12-19 22:45 -------
Subject: Re: New: faults typedef redefinition in struct
"baraclese at hotmail dot com" <gcc-bugzilla@gcc.gnu.org> writes:
| +++ This bug was initially created as a clone of Bug #7869 +++
|
| I stumbled over the second issue that the original bug report mentioned. I
| think it was closed prematurely.
| To clarify this a bit I provide my own short example.
| It may be worth noting that comeau online does not produce any errors on this
| code, nor does microsofts c++ compiler that comes with visual studio 8.
That does not make them "right", nor does it turn your invalid code
into valid code.
| struct tag{};
|
| struct A {
| tag t; // *
| typedef int tag;
| };
|
| *omit this declaration and everything is fine for g++
|
| error msg on g++3.4.4:
|
| error: declaration of `typedef int A::tag'
| error: changes meaning of `tag' from `struct tag'
|
| Why would the outer tag declaration conflict with the tag declaration in
scope
| A? This is not an error that I would have expected intuitively which is why
I'd
| like to bring this up again.
The C++ standard says that your program is ill-formed.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25497