This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17473] New: typedef redefinition in struct is accepted
- From: "llib at computer dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Sep 2004 02:11:10 -0000
- Subject: [Bug c++/17473] New: typedef redefinition in struct is accepted
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
(accepts-illegal)
the following code
"""
struct S {
typedef int Int;
typedef int Int;
};
"""
is accepted by g++. This is illegal according to 9.2/1
"""
A member shall not be be declared twice in the /member-
specification/, except that a nested class or member class
template can be declared and then later defined.
"""
Note that this conflicts with 7.1.3/2, but 9.2/1 is more specific (class-only
specification scopes).
--
Summary: typedef redefinition in struct is accepted
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: llib at computer dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: sparc-sun-solaris2.9
GCC host triplet: sparc-sun-solaris2.9
GCC target triplet: sparc-sun-solaris2.9
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17473