Path: utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bbn!mailrus!tut.cis.ohio-state.edu!PARIS.ICS.UCI.EDU!schmidt%siam.ics.uci.edu From: schmidt%siam.ics.uci.edu@PARIS.ICS.UCI.EDU ("Douglas C. Schmidt") Newsgroups: gnu.g++.bug Subject: g++ 1.32 is lax on protection Message-ID: <8901252128.aa04059@PARIS.ICS.UCI.EDU> Date: 26 Jan 89 05:28:49 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 27 According to page 3 of the USENIX Lime book, the following program is incorrect: ---------------------------------------- class X { protected: int prot; }; class Y : public X { void mf (); }; void Y::mf() { prot = 2; X a; a.prot = 3; // error, prot is protected and a is not a Y! X *p = this; p->prot = 3; // error, prot is protected and p is not a pointer to Y! } ---------------------------------------- However, g++ 1.32 does not complain about this. Doug