From mboxrd@z Thu Jan 1 00:00:00 1970 From: fonseca@mip.sdu.dk To: gcc-gnats@gcc.gnu.org Subject: c++/3816: namespace and anonymous struct identifier conflict Date: Wed, 25 Jul 2001 09:46:00 -0000 Message-id: <20010725164519.10560.qmail@sourceware.cygnus.com> X-SW-Source: 2001-07/msg00679.html List-Id: >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: