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

Reply via email to