This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/7309: Cannot create instances of privatly inherited grand-parent classes in a method of a class.
- From: gthomas at hp5 dot g8labs dot co dot nz
- To: gcc-gnats at gcc dot gnu dot org
- Date: Mon, 15 Jul 2002 18:18:20 +1200 (NZST)
- Subject: c++/7309: Cannot create instances of privatly inherited grand-parent classes in a method of a class.
>Number: 7309
>Category: c++
>Synopsis: Cannot create instances of privatly inherited grand-parent classes in a method of a class.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Jul 14 23:26:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Gene.Thomas@eServGlobal.com
>Release: 3.0.4
>Organization:
>Environment:
System: HP-UX hp5 B.11.00 A 9000/785 2002388384 two-user license
host: hppa2.0w-hp-hpux11.00
build: hppa2.0w-hp-hpux11.00
target: hppa2.0w-hp-hpux11.00
configured with: ../gcc-3.0.4/configure --prefix=/opt/gcc-3.0.4 --enable-shared --with-gnu-as --with-as=/opt/binutils-2.11/bin/as --enable-languages=c,c++ --disable-libgcj
>Description:
>How-To-Repeat:
class A {
};
class B : private A {
public:
void bf() {
A a; // this is ok
}
};
class C : public B {
public:
void cf() {
A a; // `class A' is inaccessible COMPILE ERROR
}
};
int main() {
A a; // but this is ok
return 0;
}
Fix:
void cf() {
::A a;
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: