Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!ukc!edcastle!lfcs!sam From: sam@lfcs.ed.ac.uk (S. Manoharan) Newsgroups: comp.lang.c++ Subject: Private base class Message-ID: <1553@castle.ed.ac.uk> Date: 11 Jan 90 11:48:07 GMT Reply-To: sam@lfcs.ed.ac.uk (S. Manoharan) Organization: Dept of Computer Science Edinburgh University Lines: 45 In a previous article I wrote: #Yet another What's-wrong-with-my-code question: # # 1 class base { # 2 public: # 3 int a; # 4 void f() {} # 5 }; # 6 # 7 class derived: base { # 8 public: # 9 base::a; # 10 base::f; # 11 }; # 12 # 13 # 14 void main() # 15 { # 16 derived x; # 17 # 18 x.a = 0; # 19 x.f(); # 20 } # # #Compiling this with CC (cfront version 1.2.1) gives the following #errors: #CC test.c: #"test.c", line 18: error: a is from private base class #"test.c", line 19: error: f is from private base class #2 errors Changing line 7 of the above code to: 7 class derived: private base { ~~~~~~~ results in a correct compilation. I thought `class D: B {' and class D: private B {' are always identical. Or so says BS. Still baffled. Manoharan.