Boost C++ Libraries: Ticket #8689: Solaris: make_shared<const T> compile error https://svn.boost.org/trac10/ticket/8689 <p> Compile this with Forte 11 (Sun C++ 5.8 Patch 121017-08 2006/12/06): </p> <pre class="wiki">#include &lt;boost/make_shared.hpp&gt; struct Foo { virtual ~Foo() {} }; void f() { boost::make_shared&lt;const Foo&gt;(); } </pre><p> Compiler error is: </p> <pre class="wiki">"/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&lt;const Foo&gt;::destroy()". "/usr/local/include/boost/smart_ptr/make_shared.hpp", line 86: Where: Instantiated from boost::make_shared&lt;const Foo&gt;(). "test.cpp", line 3: Where: Instantiated from non-template code. </pre><p> Further testing shows the compiler incorrectly refuses to compile an explicit destructor call on any const T* with a virtual destructor. </p> <p> Would it be worth explicitly removing const from sp_ms_deleter's template parameter? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8689 Trac 1.4.3 matthew.bergin@… Wed, 12 Jun 2013 10:38:27 GMT attachment set https://svn.boost.org/trac10/ticket/8689 https://svn.boost.org/trac10/ticket/8689 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">make_shared_const.patch</span> </li> </ul> Ticket