Path: utzoo!attcan!ncrcan!scocan!jfischer From: jfischer@sco.COM (Jonathan A. Fischer) Newsgroups: comp.lang.c++ Subject: Re: Anyone doing a G++ port of ET++ v2.0? Message-ID: <1990Oct31.164527.8061@sco.com> Date: 31 Oct 90 16:45:27 GMT References: <314@unf7.UUCP> <2336@lupine.NCD.COM> Sender: news@sco.com (News administration) Organization: SCO Canada, Inc. (nee HCR Corporation) Lines: 24 In article <2336@lupine.NCD.COM> rfg@NCD.COM (Ron Guilmette) writes: >... cfront 2.0 allowed a few >illegalities slip by. In particular: >... > cfront 2.0 apparently does not insist that the return type of > a member function in a derived class should exactly match the > return type for the function it overloads (if there is one) > in the base class. Again, g++ insisted on this (quite correctly). "Overload" is the wrong word here. The function in the derived class in fact _hides_ the function of the same name in the base class. Overloading only occurs at the same "level". class Base { ... void func( int, int ); }; class Derived: public Base { ... long func( void ); }; is perfectly legal. g++ should accept this.