🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #381

Re: bug in g++ 1.35.0 -- no fix

#381
From: Doug Schmidt
Date: Tue, 29 Aug 1989 04:27
36 lines
1594 bytes
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.
Technical Details
Message-ID: <1989Aug29.042745.2420@paris.ics.uci.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!orion.cf.uci.edu!uci-ics!news
References: <235@argosy.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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)