From: jlm@ludo.two-oo-one.fr (Jean-Louis Moser)
Subject: DEC cxx bug (Member acces control)
Date: 1995/08/04 [thread overview]
Message-ID: <JLM.95Aug4131918@ludo.two-oo-one.fr> (raw)
% 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 |
+----------------------------+------------------------------------+
reply other threads:[~1995-08-04 4:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox