Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!orion.cf.uci.edu!uci-ics!news From: schmidt@zola.ics.uci.edu (Doug Schmidt) Newsgroups: gnu.g++.bug Subject: Re: bug in g++ 1.35.0 -- no fix Keywords: visibility rules Message-ID: <1989Aug29.042745.2420@paris.ics.uci.edu> Date: 29 Aug 89 04:27:45 GMT References: <235@argosy.UUCP> Sender: news@paris.ics.uci.edu (Network News) Reply-To: schmidt@zola.ics.uci.edu (Doug Schmidt) Organization: University of California, Irvine - Dept of ICS Lines: 36 In-reply-to: becher@argosy.UUCP (Jonathan D. Becher) In article <235@argosy.UUCP>, becher@argosy (Jonathan D. Becher) writes: >We brought up g++ 1.35.0 last week and ran into a series of problems. >The only one I wasn't able to work around is the following: > >The following code incorrectly, I believe, calls the derived method >instead of the base class method. Is this still a problem in newer >versions? What can I do for a fix? >class parent { >public: > int foo() { printf("parent\n"); } >}; > >class child : public parent { >public: > int foo() { printf("child\n"); } >}; > >main() >{ > child bar; > > int i = bar.parent::foo(); >} My version of g++ (a beta 1.36 based upon gcc-1.35.97) prints parent I assume this means the bug is fixed?! Doug -- schmidt@ics.uci.edu (ARPA) | Per me si va nella citta' dolente. office: (714) 856-4043 | Per me si va nell'eterno dolore. | Per me si va tra la perduta gente. | Lasciate ogni speranza o voi ch'entrate.