Boost logo

Boost :

Subject: Re: [boost] [exception] warning about non-virtual destructor - resolution?
From: Jeffrey Lee Hellrung, Jr. (jeffrey.hellrung_at_[hidden])
Date: 2012-04-13 13:31:06


On Fri, Apr 13, 2012 at 10:15 AM, Mathias Gaunard <
mathias.gaunard_at_[hidden]> wrote:

> On 04/13/2012 03:06 PM, Hite, Christopher wrote:
>
>> This is annoying me too:
>> boost_1_49_0/boost/checked_**delete.hpp:34:5: warning: deleting object
>> of polymorphic class type 'boost::error_info<boost::tag_**original_exception_type,
>> const std::type_info*>' which has non-virtual destructor might cause
>> undefined behaviour [-Wdelete-non-virtual-dtor]
>>
>> A) easy solution
>> /boost_1_49_0/boost/exception/**detail/error_info_impl.hpp
>> It's probably easiest to just make ~error_info_base() virtual. It
>> doesn't cost much since there's already a virtual table.
>>
>
>
> This is bug #4200, and the above is the proposed resolution.
>

I seem to remember this being discussed at length in the past...I believe
this thread?

http://boost.2283326.n4.nabble.com/boost-exception-detail-error-info-base-does-not-have-virtual-destructor-td3384903.html

- Jeff


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk