🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #1656

g++ 1.32 is lax on protection

#1656
From: "Douglas C. Schmidt"
Date: Thu, 26 Jan 1989 05:28
27 lines
966 bytes
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
Technical Details
Message-ID: <8901252128.aa04059@PARIS.ICS.UCI.EDU>
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bbn!mailrus!tut.cis.ohio-state.edu!PARIS.ICS.UCI.EDU!schmidt%siam.ics.uci.edu

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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