Subject: [Boost-bugs] [Boost C++ Libraries] #8689: Solaris: make_shared<const T> compile error
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-06-12 10:19:47
#8689: Solaris: make_shared<const T> compile error
------------------------------+-----------------------
Reporter: matthew.bergin@⦠| Owner: pdimov
Type: Bugs | Status: new
Milestone: To Be Determined | Component: smart_ptr
Version: Boost 1.51.0 | Severity: Problem
Keywords: make_shared |
------------------------------+-----------------------
Compile this with Forte 11 (Sun C++ 5.8 Patch 121017-08 2006/12/06):
{{{
#include <boost/make_shared.hpp>
struct Foo { virtual ~Foo() {} };
void f() { boost::make_shared<const Foo>(); }
}}}
Compiler error is:
{{{
"/usr/local/include/boost/smart_ptr/make_shared.hpp", line 60: Error: Non-
const function Foo::__SLIP.DELETER__C() called for const object.
"/usr/local/include/boost/smart_ptr/make_shared.hpp", line 86: Where:
While instantiating "boost::detail::sp_ms_deleter<const Foo>::destroy()".
"/usr/local/include/boost/smart_ptr/make_shared.hpp", line 86: Where:
Instantiated from boost::make_shared<const Foo>().
"test.cpp", line 3: Where: Instantiated from non-template code.
}}}
Further testing shows the compiler incorrectly refuses to compile an
explicit destructor call on any const T* with a virtual destructor.
Would it be worth explicitly removing const from sp_ms_deleter's template
parameter?
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/8689> 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:13 UTC