From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f6c5c,5421351313619b1f,start X-Google-Attributes: gidf6c5c,public X-Google-Thread: fee84,5421351313619b1f,start X-Google-Attributes: gidfee84,public X-Google-Thread: f678f,5421351313619b1f,start X-Google-Attributes: gidf678f,public From: jlm@ludo.two-oo-one.fr (Jean-Louis Moser) Subject: DEC cxx bug (Member acces control) Date: 1995/08/04 Message-ID: #1/1 X-Deja-AN: 107556466 distribution: world organization: 2001 S.A. followup-to: comp.unix.osf.osf1 newsgroups: comp.unix.osf.osf1,comp.unix.osf.misc,fr.test % cxx -V cxx (cxx) DEC C++ V5.0-3 for DEC OSF/1 (Alpha) ---------------------------------------------- class A { protected: //^^^^^^^ int a_; }; class B1 : public A { }; class B2 : public A { int foo (A& a, B1& b1, B2& b2) { const int _a = a.a_; // error: In the initializer for _a, "A::a_" is not accessible. const int _b1 = b1.a_; // Here is the bug. CXX would detect an error. g++ do it: //^^^^^^^^^^^^^^^^^^^^^^ // (member `a_' is protected) and ISO/IEC JTC1/SC22 too const int _b2 = b2.a_; // OK const int _this = a_; // OK return _a + _b1 + _b2 + _this; } }; ---------------------------------------------- -- +----------------------------+------------------------------------+ | Jean-Louis Moser | 2001 SA | | tel: 33 (1)46.66.54.54 | 2, rue de la renaissance | | Email: jlm@two-oo-one.fr | F-92184 Antony Cedex | +----------------------------+------------------------------------+