This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/32053] New: Anonymous union members' names should be distinct within enclosing scope
- From: "andrew dot stubbs at st dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 May 2007 09:05:09 -0000
- Subject: [Bug c++/32053] New: Anonymous union members' names should be distinct within enclosing scope
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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