This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/3816: namespace and anonymous struct identifier conflict
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/3816: namespace and anonymous struct identifier conflict
- From: fonseca at mip dot sdu dot dk
- Date: 25 Jul 2001 16:45:19 -0000
- Reply-To: fonseca at mip dot sdu dot dk
>Number: 3816
>Category: c++
>Synopsis: namespace and anonymous struct identifier conflict
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Wed Jul 25 09:46:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: René Fonseca
>Release: gcc-3.0 and gcc-2.95-3 and more
>Organization:
>Environment:
GNU/Linux (RedHat 7.1), Windows 2000 (Cygwin), and Solaris 8.
>Description:
GCC fails to compile a valid typedef of an anonymous struct when the name of the typedef is identical to a namespace in an outer scope.
See the code below to reproduce the problem. The line resulting in the error has been marked with "// conflict with A namespace!!!".
>How-To-Repeat:
Here is some code that illustrates the problem:
namespace A {};
namespace OtherNamespace {
typedef struct {
int member;
} A; // conflict with A namespace!!!
}; // end of namespace
int main() {
return 0;
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: