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++/486: nested class forward declaration not recognized



>Number:         486
>Category:       c++
>Synopsis:       nested class forward declaration not recognized
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 23 15:16:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     daniel@cs.washington.edu
>Release:        Reading specs from /uns/gcc-2.95.2/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs gcc version 2.95.2 19991024 (release)
>Organization:
>Environment:

>Description:
Simultaneously forward declaring a nested class and a
pointer to the class doesn't work because the compiler
sees the nested class as being in the global scope.
>How-To-Repeat:
This doesn't compile
-----------------------------------------------------
struct A
{
//    struct B;
    struct B *b;
};

struct A::B
{
    int x;
};
-----------------------------------------------------

But it will if the 3rd line is uncommented.
>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]