Path: utzoo!attcan!uunet!zephyr.ens.tek.com!uw-beaver!mit-eddie!bloom-beacon!eru!luth!sunic!tut!funic!santra!hutcs.hut.fi!jaa From: jaa@hutcs.hut.fi (Jari Alasuvanto) Newsgroups: comp.lang.c++ Subject: protected members Message-ID: <1990Jun21.110634.10468@santra.uucp> Date: 21 Jun 90 11:06:34 GMT Sender: news@santra.uucp (Cnews - USENET news system) Organization: Helsinki University of Technology, Finland Lines: 41 We ran into the following problems when switching from 1.2 (Glockenspiel) to 2.0 (Sun). Let's make a simple example: class first { int val2 ; protected: void foo() ; } ; class second : public first { int val ; } ; class third : public first { void bar(second& ref) ; } ; void first::foo() {} void third::bar(second& ref) { ref.foo() ;} produces an error message on sparc, Sun's 2.00 CC "tmp.cxx", line 22: error: third::bar() cannot access first::foo(): protected member 1 error but passes OK with Glockenspiel 1.2 on sun3. The question is: Is this a new (redefined) feature of 2.0 or does one of the compilers have a bug in handling this kind of code ? Thanks in advance, sorry if this has been asked earlier in this group. Jari Alasuvanto -- Jari Alasuvanto Lab. of Information Proc. Science, Helsinki Univ. of Techology, Finland Internet: jaa@hutcs.hut.fi Bitnet: jaa%finhutcs.bitnet tel: +358-0-451 3236 fax: +358-0-465 077