Boost C++ Libraries: Ticket #11324: has_nothrow_default_constructor incorrectly returns true https://svn.boost.org/trac10/ticket/11324 <p> The following test program reports errors on the newly added SunOS testers oracle-intel-S2-stlport4 and oracle-sparc-S2-stlport4: </p> <pre class="wiki">#include &lt;boost/type_traits/has_nothrow_constructor.hpp&gt; #include &lt;boost/core/lightweight_test.hpp&gt; #include &lt;boost/core/lightweight_test_trait.hpp&gt; namespace some_namespace { class base_class { public: base_class &amp; operator=(const base_class &amp;){ throw int(); } virtual ~base_class() {} }; class class_without_default_ctor : public base_class { public: char data; explicit class_without_default_ctor(char arg) : data(arg) {} }; } int main() { BOOST_TEST_TRAIT_FALSE((boost::has_nothrow_default_constructor&lt;some_namespace::class_without_default_ctor&gt;)); return boost::report_errors(); } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11324 Trac 1.4.3 John Maddock Wed, 20 May 2015 16:58:54 GMT <link>https://svn.boost.org/trac10/ticket/11324#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11324#comment:1</guid> <description> <p> Works for me on msvc and gcc, I assume this is the Oracle C++ compiler? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Wed, 20 May 2015 18:09:00 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/11324#comment:2 https://svn.boost.org/trac10/ticket/11324#comment:2 <ul> <li><strong>cc</strong> <span class="trac-author">akrzemi1@…</span> added </li> </ul> <p> This is an issue in the compiler intrinsics <span class="underline">oracle_has_trivial_constructor and </span>oracle_has_nothrow_constructor both of which report true for class_without_default_ctor. </p> <p> There is a fix, but it requires adding a new trait is_default_constructible so this may not happen right away. </p> Ticket John Maddock Thu, 21 May 2015 10:59:49 GMT <link>https://svn.boost.org/trac10/ticket/11324#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11324#comment:3</guid> <description> <p> Forgot to mention - the fix I have in mind can only be made to work in C++11 land - so would not be applicable for Oracle-stlport which is rather antiquated these days :( </p> </description> <category>Ticket</category> </item> <item> <dc:creator>akrzemi1</dc:creator> <pubDate>Thu, 21 May 2015 11:17:44 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11324#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11324#comment:4</guid> <description> <p> For me, the acceptable minimum solution is that the enclosed test case is added to the regression test matrix (and can be marked as expected failure). This way I can see that the root of the problem goes to <a class="missing wiki">TypeTraits</a> library. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Thu, 21 May 2015 17:41:13 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11324#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11324#comment:5</guid> <description> <p> Added in <a class="ext-link" href="https://github.com/boostorg/type_traits/commit/9f489b0d718c3754a1d176ec7e88964320457a1e"><span class="icon">​</span>https://github.com/boostorg/type_traits/commit/9f489b0d718c3754a1d176ec7e88964320457a1e</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>akrzemi1</dc:creator> <pubDate>Fri, 22 May 2015 07:35:30 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11324#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11324#comment:6</guid> <description> <p> One note. the ideal implementation would correctly detect when a type T has a default noexcept constructor or not. The minimum correct implementation can just always return false. Currently, there are situations where it returns true for types without default constructor. Only implementing the minimum would be an improvement. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Thu, 28 May 2015 16:19:30 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11324#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11324#comment:7</guid> <description> <p> Nod. I will get to this as part of the migration to the "version 2" type traits. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Thu, 18 Jun 2015 17:23:42 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11324#comment:8 https://svn.boost.org/trac10/ticket/11324#comment:8 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> This should now be fixed in develop. </p> Ticket