(ref.doc)maxtal 250793

Next maxtal 010893 Prev: bs 220793 Up: Usenet

Newsgroups: comp.lang.c++,comp.std.c++
From: [email protected] (John Max Skaller) (Note:
 Skaller)
Subject: Re: virtual base and virtual functions
Nntp-Posting-Host: physics.su.oz.au
Organization: School of Physics, University of Sydney, Australia
Date: Sun, 25 Jul 1993 12:13:24 GMT

In article <[email protected]> [email protected] (Robert Martin) writes:
>"Bradley D. Keister" <[email protected]> writes:
>
>>I have a class hierarchy which starts with a base class, is inherited
>>virtually by two separate branches, and then the branches are brought
>>together by multiple inheritence for the class used in the
>>application.  Some pure virtual functions are declared in the base
>>class which are all eventually defined along one branch, but not the
>>other.  For the (multiply inherited) class I use, all functions are
>>therefore defined and unambiguous.  
>
>>g++ 2.4.5
>>compiles successfully and the program performs as expected.  For
>>cfront 3.1, however, the test program gives a compile-time error,
>>claiming that the final class is abstract; the actual application
>>compiles, but the executable gives segmentation faults.
>
>The ARM, 10.3,  pg 215  says: "Pure virtual functions are inherited as
>pure virtual functions."  
>
>So, it would appear that cfront should indeed be complaining since the
>purity of the virtual functions is being inherited.  

	No, cfront 3.0.1 is bugged. The bug is fixed in 3.0.2. 
The wording of the section on abstract classes is sloppy and needs
to be fixed. A class is abstract if, and only if, a virtual
call(**) might invoke a pure virtual function. If all the pure virtuals
are overridden, the class is concrete.

**Invoked after the constructor body of the most complete class
is entered, and before destruction commences.

--
        JOHN (MAX) SKALLER,         INTERNET:[email protected]
	Maxtal Pty Ltd,		    CSERVE:10236.1703 
        6 MacKay St ASHFIELD,	    Mem: SA IT/9/22,SC22/WG21 
        NSW 2131, AUSTRALIA	    


automatically generated by info2www version 1.2.2.8