🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

bug with -Woverloaded-virtual

#38
From: Alan Shepherd
Date: Wed, 04 Nov 1992 14:44
56 lines
1611 bytes
gcc -v:

Reading specs from /usr/local/lib/gcc-lib/sun4/2.3.1/specs
gcc version 2.3.1

-Woverloaded-virtual causes incorrect error messages (not warnings)to
appear in the code inclued below.  Subclassing from Object is
important so again I guess that it is something to do with virtual
functions and inheritance.

without -Woverloaded-virtual:

gas@vulcan% gcc -g -Wall bug2.C -c
gas@vulcan% 

with -Woverloaded-virtual:

gas@vulcan% gcc -g -Wall -Woverloaded-virtual bug2.C
bug2.C:21: conflicting specification deriving virtual function `int  foo::anOp (int, int)'
gas@vulcan%

Thanks,

Alan Shepherd

-------------

class Object
{
    int a;

public:
    
    Object();
    virtual ~Object();

    virtual void doNothing();
};

class foo :public Object{

public:

    foo();
    virtual ~foo();

    virtual int anOp(const char*, int);
    virtual int anOp(int, int);
};



---------
Alan Shepherd, X-Tel Services Ltd., University Park, Nottingham NG7 2RD.
Email: a.shepherd@xtel.co.uk, Phone: +44 (0) 602 514591 (Fax:790278)
X.400: C=GB;ADMD= ;PRMD=X-Tel Services;O=X-Tel;S=Shepherd;G=Alan
Technical Details
Message-ID: <27394.720888251@xtel.co.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!xtel.co.uk!a.shepherd

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!xtel.co.uk!a.shepherd
From: a.shepherd@xtel.co.uk (Alan Shepherd)
Subject: bug with -Woverloaded-virtual
Message-ID: <27394.720888251@xtel.co.uk>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Wed, 4 Nov 1992 14:44:11 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 58