[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-bugs
Subject:    c++/2125: Namespaces are confused by forward-referencing typedefs
From:       stephen.webb () cybersafe ! com
Date:       2001-02-28 14:49:09
[Download RAW message or body]


>Number:         2125
>Category:       c++
>Synopsis:       Namespaces are confused by forward-referencing typedefs
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 28 06:56:03 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     stephen.webb@cybersafe.com
>Release:        gcc version 3.0 20010219 (prerelease)
>Organization:
>Environment:

>Description:
The following code fragment 

// begin oink.cpp
namespace A {
  typedef class C C;
  typedef int T;
  class C { T i; };
}
// end oink.cpp

produces the following error when compiled with "gcc -c oink.cpp".

oink.cpp:4: syntax error before `;' token 

This code is accepted by gcc 2.95.2 and MSVC 12.00.8804.

Note that the following code is accepted.

// ... begin oink2.cpp
namespace A {
  typedef class C C;
  typedef int T;
  class C { A::T i; };
}
// ... end oink2.cpp

This example was distilled from preprocessed Solaris 8 system headers.

>How-To-Repeat:
See description.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic