🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

g++ 1.27 allows invalid operation on derived classes

#1537
From: "Douglas C. Schmidt"
Date: Thu, 24 Nov 1988 00:27
36 lines
1089 bytes
Hi,

   I believe the following is illegal in C++.  The AT&T compiler
complains that:

----------------------------------------
CC  test.C:
"test.C", line 14: error:  foo::foo() is from a private base class
----------------------------------------

which makes sense.  However, g++ 1.27 accepts this without complaint.

Here's the code:

----------------------------------------
#include <stream.h>

class foo {
public:
   foo () { ; }
};

class bar : foo {
public:
};

main () {
   bar b;
}
----------------------------------------


thanks,

Doug
Technical Details
Message-ID: <8811231627.aa15269@PARIS.ICS.UCI.EDU>
Path: arc1-ca.pugleaf.net!utzoo!yunexus!telly!ddsw1!mcdchg!rutgers!tut.cis.ohio-state.edu!ORION.CF.UCI.EDU!schmidt%blanche.ics.uci.edu

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!yunexus!telly!ddsw1!mcdchg!rutgers!tut.cis.ohio-state.edu!ORION.CF.UCI.EDU!schmidt%blanche.ics.uci.edu
From: schmidt%blanche.ics.uci.edu@ORION.CF.UCI.EDU ("Douglas C. Schmidt")
Newsgroups: gnu.g++.bug
Subject: g++ 1.27 allows invalid operation on derived classes
Message-ID: <8811231627.aa15269@PARIS.ICS.UCI.EDU>
Date: 24 Nov 88 00:27:24 GMT
Article-I.D.: PARIS.8811231627.aa15269
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 36