This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/20397] New: g++ rejects valid code with 'is inaccessible' error
- From: "matthew dot whitney at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Mar 2005 21:24:38 -0000
- Subject: [Bug c++/20397] New: g++ rejects valid code with 'is inaccessible' error
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Example code:
class A {
};
class B : A {
};
class C : B {
public:
int c(A *a) { return 7; }
};
int main() {
A a;
C c;
return c.c( &a );
}
Gives the error message:
g++ main.cc
main.cpp:1: `class A' is inaccessible
main.cpp:9: within this context
Which is true, but not relevant. C never tries to access A through B.
--
Summary: g++ rejects valid code with 'is inaccessible' error
Product: gcc
Version: 3.4.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: matthew dot whitney at gmail dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20397