Are private base classes really private ?

David C Binderman dcb@pncl.co.uk
Sun Aug 23 02:00:00 GMT 1998


Hello there,

On Linux/ Alpha, with egcs-980816 -ansi -pedantic, no error was found for
the following code.

struct A { };
struct B : private A {};

B b;
A* pa = (A *) &b; // should fail here, according to 15.3.2 of Stroustrup 3.

Top of page 406 in my copy of Stroustrup 3.

Regards



David C Binderman MSc BSc	+44 1293 534847		dcb@pncl.co.uk




More information about the Gcc-bugs mailing list