This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: pure virtual method called "bug"
- To: binutils at sourceware dot cygnus dot com
- Subject: Re: pure virtual method called "bug"
- From: Tom Smith <tsmith13 at darwin dot helios dot nd dot edu>
- Date: Tue, 23 Oct 2001 10:24:02 -0500 (EST)
Hopefully,
this is the right address to inquire about bugs...
Sincerely,
Tom
On Tue, 23 Oct 2001, GNU General Contact Address wrote:
> You should send this question to the binutils users' mailing list:
> binutils@sourceware.cygnus.com. You can subscribe to the mailing list by
> sending the word "subscribe" to the address
> binutils-subscribe@sourceware.cygnus.com, or by visiting the site
> http://sourceware.cygnus.com/binutils/index.html.
>
> Good luck and happy hacking!
>
> On Tue, Oct 23, 2001 at 04:53:12AM -0500, Tom Smith wrote:
> > Hello,
> > Tried mailing gnu-bin-utils@gnu.org for this bug,
> > but their email link was inoperative. Was wondering
> > if a new GCC version addresses this problem, or if patches
> > or fixes exist.
> >
> > Sincerely,
> > Tom Smith
> >
> > On Sat, 13 Oct 2001, Tom Smith wrote:
> >
> > >
> > > Hello,
> > > I was wondering if this bug has been fixed
> > > in a new version of g++, perhaps generating a
> > > warning...
> > >
> > > However, at least this aborts ...
> > >
> > > compiler: gcc version 2.95.2 19991024 (release)
> > > OS: Sun Solaris 2.8, (sparc chip)
> > > code to replicate bug taken from web mainly
> > > and tested.
> > >
> > > code, no compile options, ./a.out to run
> > > *****
> > > #include <iostream>
> > >
> > > struct A {
> > > virtual void f() const=0; // function f looking for implementation ..
> > > virtual ~A() { }
> > > };
> > >
> > > struct B : public A { // B derived from a
> > > virtual ~B() { }
> > > virtual void f() const { std::cout<< "hello" << std::endl;}
> > > };
> > >
> > > struct C {
> > > const A& a; // instantiated reference to object a of type A
> > > C(const A& a_init=B()) : a(a_init)
> > > { //constructor for C
> > > a.f(); // okie dokie
> > > }
> > >
> > > void g() { a.f(); }
> > > // not so okie dokie for g++ 2.95.2 19991024 (release)
> > > // okie dokie for CC(?): Sun WorkShop 6 update 1 C++ 5.2 2000/09/11
> > > }; // end C
> > >
> > >
> >
>
> --
> Orion Montoya, FSF Office Staff
> Free Software Foundation | Phone: +1-617-542-5942
> 59 Temple Place, Suite 330 | Fax: +1-617-542-2652
> Boston, MA 02111-1307 USA | Web: http://www.gnu.org
>