[gnu.g++.bug] friendly access to private base classes

keffer@SPERM.OCEAN.WASHINGTON.EDU (Tom Keffer) (12/13/89)

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