This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: egcs-1.1.2 create abstract class


Carlo Wood wrote:
> 
> Hiya, I got this one from a news group
> 
>  From: raoulgough@my-deja.com
>  Newsgroups: comp.lang.c++.moderated
>  Subject: Compiler automatically generates abstract object (crash)
>  Date: 29 Sep 1999 02:44:17 -0400
> 
> ~/c++/tests>g++ abstract.cc
> ~/c++/tests>a.out
> virtfn from object at 0xbffff4b4
> pure virtual method called
> 
> Reason being that g++ happily constructed an abstract object,
> with a pure virtual function.  I am not 100% sure this is bug
> but I thought I'd let you know.
The gcc 2.95 moans really loadly,

fart.cc: In function `int main (...)':
fart.cc:32: cannot allocate an object of type `const Abstract'
fart.cc:32:   since the following virtual functions are abstract:
fart.cc:7:      void Abstract::virtfn () const
fart.cc:24: in passing argument 1 of `call_virtfn (const Abstract &)'

nathan
-- 
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
        I have seen the death of PhotoShop -- it is called GIMP
nathan@acm.org  http://www.cs.bris.ac.uk/~nathan/  nathan@cs.bris.ac.uk

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]