This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/35640] New: invalid access to protected base class
- From: "mrs at apple dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Mar 2008 17:25:09 -0000
- Subject: [Bug c++/35640] New: invalid access to protected base class
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
class A {
};
class B: protected A {
};
class C: protected A {
public:
C(B & b);
};
C::C(B & b)
: A(b)
{
}
int main() {
B b;
C c(b);
return 0;
}
should give an error for : A(b), the conversion from B to A is invalid as A is
protected.
This still fails on 4.4.0 20080317
radr://5805511
--
Summary: invalid access to protected base class
Product: gcc
Version: 4.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mrs at apple dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35640