Subject: [Boost-bugs] [Boost C++ Libraries] #6824: warning: delete called on boost::error_info... that has virtual functions but non-virtual destructor
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-04-23 21:19:52
#6824: warning: delete called on boost::error_info... that has virtual functions
but non-virtual destructor
------------------------------------------------+---------------------------
Reporter: Richard Powell <rmpowell77@â¦> | Owner: anthonyw
Type: Bugs | Status: new
Milestone: To Be Determined | Component: thread
Version: Boost 1.49.0 | Severity: Problem
Keywords: |
------------------------------------------------+---------------------------
When compiling boost 1.49.0 thread.hpp with clang with -Wall, I receive
warnings:
/Users/richardpowell/boost/include/boost/checked_delete.hpp:34:5: warning:
delete called on
'boost::error_info<boost::tag_original_exception_type, const
std::type_info *>' that has virtual functions but non-virtual destructor
[-Wdelete-non-virtual-dtor]
delete x;
=-=-=
More details:
$ cat test2.cpp
#include <boost/thread.hpp>
$ clang++ --version
Apple clang version 4.0 (tags/Apple/clang-421.0.11) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.3.0
Thread model: posix
$ clang++ -g -I. -Wall -I ~/boost/include -c test2.cpp
In file included from test2.cpp:1:
In file included from
/Users/richardpowell/boost/include/boost/thread.hpp:13:
In file included from
/Users/richardpowell/boost/include/boost/thread/thread.hpp:17:
In file included from
/Users/richardpowell/boost/include/boost/thread/pthread/thread_data.hpp:10:
In file included from
/Users/richardpowell/boost/include/boost/shared_ptr.hpp:17:
In file included from
/Users/richardpowell/boost/include/boost/smart_ptr/shared_ptr.hpp:30:
/Users/richardpowell/boost/include/boost/checked_delete.hpp:34:5: warning:
delete called on
'boost::error_info<boost::tag_original_exception_type, const
std::type_info *>' that has virtual functions but non-virtual destructor
[-Wdelete-non-virtual-dtor]
delete x;
^
/Users/richardpowell/boost/include/boost/smart_ptr/detail/shared_count.hpp:95:13:
note: in instantiation of function template specialization
'boost::checked_delete<boost::error_info<boost::tag_original_exception_type,
const std::type_info *> >' requested here
boost::checked_delete( p );
^
/Users/richardpowell/boost/include/boost/smart_ptr/shared_ptr.hpp:183:44:
note: in instantiation of function template specialization
'boost::detail::shared_count::shared_count<boost::error_info<boost::tag_original_exception_type,
const std::type_info *> >' requested here
explicit shared_ptr( Y * p ): px( p ), pn( p ) // Y must be complete
^
/Users/richardpowell/boost/include/boost/exception/info.hpp:170:42: note:
in instantiation of function template specialization
'boost::shared_ptr<boost::error_info<boost::tag_original_exception_type,
const std::type_info *>
>::shared_ptr<boost::error_info<boost::tag_original_exception_type,
const std::type_info *> >' requested here
shared_ptr<error_info_tag_t> p( new error_info_tag_t(v) );
^
/Users/richardpowell/boost/include/boost/exception/info.hpp:191:16: note:
in instantiation of function template specialization
'boost::exception_detail::set_info<boost::unknown_exception,
boost::tag_original_exception_type, const std::type_info *>' requested
here
return exception_detail::set_info(x,v);
^
/Users/richardpowell/boost/include/boost/exception/detail/exception_ptr.hpp:181:21:
note: in instantiation of function template specialization
'boost::operator<<<boost::unknown_exception,
boost::tag_original_exception_type, const std::type_info *>' requested
here
(*this) << original_exception_type(&typeid(e));
^
/Users/richardpowell/boost/include/boost/exception/detail/exception_ptr.hpp:160:13:
note: in instantiation of function template specialization
'boost::unknown_exception::add_original_type<std::exception>'
requested here
add_original_type(e);
^
1 warning generated.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6824> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:09 UTC