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++/32053] New: Anonymous union members' names should be distinct within enclosing scope


The following program should not compile:

extern int foo;
static union
{
 int foo; // clash
};

C++ standard clause 9.5/2 states that members of anonymous unions must have
names distinct from other names in the same scope.

If the `extern' keyword is removed from the example above, the error is
diagnosed correctly (followed by an ICE).


-- 
           Summary: Anonymous union members' names should be distinct within
                    enclosing scope
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: andrew dot stubbs at st dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32053


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