On 2019-10-15 12:06, Alexander Grund via Boost wrote:
Am 15.10.19 um 10:48 schrieb Andrey Semashev via Boost:
On 2019-10-15 10:06, Alexander Grund via Boost wrote:
Where does 'exception.hpp' come from? I'd expect it at https://github.com/boostorg/exception/tree/develop/include/boost/exception/e... but it isn't there...
Then it looks like the warning is indeed correct: https://github.com/boostorg/throw_exception/blob/e2e802e5085e10db7d5ee5ded4c...
`error_info_container` has a non-virtual dtor although it does have other virtual methods and the derived class has a `delete this` but is not final. Hence the compiler can't be sure that there isn't another derived class.
Any reason to NOT make the dtor virtual? Performance degrade can be resolved by making the derived class final (where supported which should be almost everywhere nowadays)
The warning is bogus because the object is never destroyed through the base class. Marking the destructor virtual would suggest that that is possible. And add a virtual call where none is needed. Marking error_info_container_impl final should help, but we currently don't have a macro for that. I created a PR to add one: https://github.com/boostorg/config/pull/299 After it is merged, Boost.Exception can be updated to take advantage of it.