Path: utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!SPERM.OCEAN.WASHINGTON.EDU!keffer From: keffer@SPERM.OCEAN.WASHINGTON.EDU (Tom Keffer) Newsgroups: gnu.g++.bug Subject: friendly access to private base classes Message-ID: <8912130155.AA29594@sperm.ocean.washington.edu> Date: 13 Dec 89 01:55:50 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 31 There seems to be a difference in interpretation between cfront 2.0 and g++ in whether a friend function has access to a private base class. The following code compiles without protest with cfront 2.0, but gives an error with g++ 1.36.1: class Base { }; class Derived : private Base { friend void foo(Derived& d); }; void func(Base&); void foo(Derived& d){ func(d); } Results: sperm[tmp]% g++ -c friend.cc friend.cc: In function void foo (class Derived &): friend.cc:11: type `Derived' is derived from private `Base' -tk --- Dr. Thomas Keffer | Internet: keffer@ocean.washington.edu Rogue Wave | BITNET: keffer%ocean.washington.edu@UWAVM Seattle, WA 98145 | uucp: uw-beaver!ocean.washington.edu!keffer (206) 523-5831 | Telemail: T.KEFFER/OMNET