This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/17473] New: typedef redefinition in struct is accepted


(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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]