🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Jonathan D. Becher Mon, 28 Aug 1989 22:10
bug in g++ 1.35.0 -- no fix
#380
Author: Jonathan D. Becher
Date: Mon, 28 Aug 1989 22:10
36 lines
1458 bytes
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?

g++ version 1.35.0
  /usr/local/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -D__cplusplus -Dvax -Dunix -D__vax__ -D__unix__ t.cc /tmp/cca04568.cpp
GNU CPP version 1.35
  /usr/local/lib/gcc-cc1plus /tmp/cca04568.cpp -quiet -dumpbase t.cc -noreg -version -o /tmp/cca04568.s
GNU C++ version 1.35.0 (vax) compiled by GNU C version 1.34.
  as /tmp/cca04568.s -o t.o
  /usr/local/lib/gcc-ld++ -C /usr/local/lib/crt0+.o t.o -lg++ /usr/local/lib/gcc-gnulib -lc

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();
}


Jon Becher
argosy!becher@decwrl.dec.com
"Why is live, evil spelled backwards?"
Re: bug in g++ 1.35.0 -- no fix
#381
Author: 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.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads