Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-ncis!helios.ee.lbl.gov!pasteur!ucbvax!decwrl!csdpie.dec.com!vilot From: vilot@csdpie.dec.com (Michael J. Vilot) Newsgroups: comp.lang.c++ Subject: Visibility Bug in 1.2? Message-ID: <8901062306.AA16858@decwrl.dec.com> Date: 6 Jan 89 23:06:25 GMT Organization: Digital Equipment Corporation Lines: 45 On p. 196 of "The C++ Programming Language," Bjarne describes the semantics of class member visibility for derived classes, and says: "It is also possible to declare some, but not all, of the public members of a base class public members of a derived class." He goes on to demonstrate it in an extension to an example. In the example, he never actually shows an example of code accessing it ... here's a fragment that fails: class Base { int z; public: int d, e; }; class Derived : Base { // Base's members are now private in Derived int a, b, c; // also private public: Base::d; // should make Base::d public }; main() { Derived y; y.d =1; // error reported here } Here's the transcript: designer C++ Programming System, release 1.2 Vms4.5.1 Copyright 1987, Glockenspiel Ltd., Dublin, Ireland Glockenspiel System V.3 compatible C pre-processor, release.4 AT&T C++ Translator, release 1.2 Vms4.5.1 Copyright 1984 AT&T, Inc. and 1987 Glockenspiel Ltd. "test.cxx;0", line 17: error: d is from private base class Error executing command CFXX +L +l +ftest.CXX;0