This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Are private base classes really private ?



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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]