This is the mail archive of the gcc-prs@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]

c++/3816: namespace and anonymous struct identifier conflict



>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:


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