This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/9122: qualified name forced to be used in non-public derived class
- From: hou_zhenyu at hotmail dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 2 Jan 2003 04:55:00 -0000
- Subject: c++/9122: qualified name forced to be used in non-public derived class
- Reply-to: hou_zhenyu at hotmail dot com
>Number: 9122
>Category: c++
>Synopsis: qualified name forced to be used in non-public derived class
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Jan 01 20:56:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: hou_zhenyu@hotmail.com
>Release: unknown-1.0
>Organization:
>Environment:
Win2k + mingw2.0(gcc3.2, and rc2 of gcc3.2.1);
Redhad Linux 8.0 + gcc3.2
>Description:
If a class inhereit from another class which further non-publicly inherit yet another third class. Any member or parameters that use not full qualified name of the third class will fail to compile.
"`class XXX' is inaccessible"
in which XXX is the name of the third class.
gcc 2.95-3 does not has this problem.
>How-To-Repeat:
// test.cpp, compile with "g++ -c test.cpp"
class A {};
class B : A {};
class C : public B {
public:
A* p; // compiler report : `class A' is inaccessible
};
>Fix:
// test.cpp
class A {};
class B : A {};
class C : public B {
public:
::A* p; // full qualified, ok
};
>Release-Note:
>Audit-Trail:
>Unformatted: