Re: BUG: compiler allows for creation of objects without destructor compiled
From: David Olsen (qg4h9ykc5m_at_yahoo.com)
Date: 04/08/04
- Next message: Maxim Yegorushkin: "Re: BUG: compiler allows for creation of objects without destructor compiled"
- Previous message: NeoGeo: "RE: unresolved external symbol"
- In reply to: Maxim Yegorushkin: "Re: BUG: compiler allows for creation of objects without destructor compiled"
- Next in thread: Maxim Yegorushkin: "Re: BUG: compiler allows for creation of objects without destructor compiled"
- Reply: Maxim Yegorushkin: "Re: BUG: compiler allows for creation of objects without destructor compiled"
- Reply: Maxim Yegorushkin: "Re: BUG: compiler allows for creation of objects without destructor compiled"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 08 Apr 2004 14:34:53 -0700
Maxim Yegorushkin wrote:
> David Olsen wrote:
>> According to the C++ standard (12.4/5) it is not an error to define a
>> class whose destructor cannot be defined (class "derived" in your
>> example). But it is an error to actually call the destructor of that
>> class.
>
> Does it mean that Comeau is wrong about producing the error message in
> Hendrik Schober's posting?
Yes and no. Comeau online (http://www.comeaucomputing.com/tryitout/)
seems to have it bugs in this area, which are different than VC's bugs.
It correctly accepts:
class base { virtual ~base() { } };
class derived : public base { };
But it rejects the following, which should be valid code because the
destructor is never used:
class base { virtual ~base() { } };
class derived : public base { };
derived *f() { return new derived; }
And it accepts the following, which it should reject because the
destructor is used:
class base { virtual ~base() { } };
class derived : public base { };
void f(derived *x) { delete x; }
-- David Olsen qg4h9ykc5m@yahoo.com
- Next message: Maxim Yegorushkin: "Re: BUG: compiler allows for creation of objects without destructor compiled"
- Previous message: NeoGeo: "RE: unresolved external symbol"
- In reply to: Maxim Yegorushkin: "Re: BUG: compiler allows for creation of objects without destructor compiled"
- Next in thread: Maxim Yegorushkin: "Re: BUG: compiler allows for creation of objects without destructor compiled"
- Reply: Maxim Yegorushkin: "Re: BUG: compiler allows for creation of objects without destructor compiled"
- Reply: Maxim Yegorushkin: "Re: BUG: compiler allows for creation of objects without destructor compiled"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|