Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* DEC cxx bug (Member acces control)
@ 1995-08-04  4:00 Jean-Louis Moser
  0 siblings, 0 replies; only message in thread
From: Jean-Louis Moser @ 1995-08-04  4:00 UTC (permalink / 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            |
+----------------------------+------------------------------------+



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1995-08-04  4:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-08-04  4:00 DEC cxx bug (Member acces control) Jean-Louis Moser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox