🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

G++ 1.34.2 overloaded virtual functions

#1910
From: Jerry Wedekind
Date: Wed, 26 Apr 1989 19:55
36 lines
1368 bytes
Environment:  g++ 1.34.2, Sun3 OS4.

G++ seems to have a bug with overloaded virtual functions.  In the test case:

    class A {
    public:
        virtual void XXX (int);
    };

    class B : public A {
    public:
        void XXX (int);
        void XXX (char);
    };

It complains:

    "test.h:9: conficting specification deriving virtual function 'void B::XXX (float)'

It should be the case that XXX(int) is virtual in A & B, and XXX is
overloaded in B.  The situation is clear:  if you have an A.XXX(int)
use the virtual function table, and if you call B.XXX, you use the
overloaded function rules & then virtual (if needed).  It doesn't help
to make A.XXX overloaded, since it still complains about any new
overloaded functions in B.

This test case works in g++ 1.32 & Oregon C++.

Is this illegal (and two other compilers are wrong), or is there a
workaround in 1.34.2?

/John

arpa:  JWenn.esae@Xerox.com
uucp:  wedekind@arisia.uucp
Technical Details
Message-ID: <715@arisia.Xerox.COM>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!ames!lll-winken!arisia!wedekind

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!ames!lll-winken!arisia!wedekind
From: wedekind@arisia.Xerox.COM (Jerry Wedekind)
Newsgroups: gnu.g++.bug
Subject: G++ 1.34.2 overloaded virtual functions
Message-ID: <715@arisia.Xerox.COM>
Date: 26 Apr 89 19:55:32 GMT
Reply-To: wedekind@arisia.UUCP (Jerry Wedekind)
Organization: Xerox PARC
Lines: 36