This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Protected member functions
- To: egcs-bugs at cygnus dot com
- Subject: Protected member functions
- From: bwoodard at cisco dot com
- Date: Fri, 27 Feb 1998 09:42:09 -0800
I looked in my 1990 edition of the annotated C++ reference manual and
I can't find any reason why the call to head.getdata() illegal. I
believe it to be a bug. It seems like gcc 2.7.3 has the same
problem. Unfortunately I do not have a different c++ compiler to test
it against. Is there a something that I am missing or is this in fact
a bug?
class BerBase {
protected:
char *getdata();
int i;
};
class BerSequence: public BerBase{
public:
BerSequence();
};
BerSequence::BerSequence(){
BerBase head;
head.getdata();
i=1;
}
The error messages are:
test.C: In method `BerSequence::BerSequence()':
test.C:3: `char * BerBase::getdata()' is protected
test.C:14: within this context