This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/31454] New: "protected" protects againt derived class
- From: "igodard at pacbell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Apr 2007 02:51:33 -0000
- Subject: [Bug c++/31454] New: "protected" protects againt derived class
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The code:
struct base {
protected:
virtual void foo() {}
};
struct der : public base {
virtual void foo() { p->foo(); }
base* p;
};
gets you:
~/ootbc/sim/test$ g++ foo.cc
foo.cc: In member function 'virtual void der::foo()':
foo.cc:3: error: 'virtual void base::foo()' is protected
foo.cc:7: error: within this context
--
Summary: "protected" protects againt derived class
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: igodard at pacbell dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31454