Opened 7 years ago

Closed 7 years ago

#11325 closed Bugs (duplicate)

has_nothrow_default_constructor incorrectly returns true

Reported by: anonymous Owned by: John Maddock
Milestone: To Be Determined Component: type_traits
Version: Boost 1.58.0 Severity: Problem
Keywords: Cc:

Description

The following test program reports errors on the newly added SunOS testers oracle-intel-S2-stlport4 and oracle-sparc-S2-stlport4:

#include <boost/type_traits/has_nothrow_constructor.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/core/lightweight_test_trait.hpp>

namespace some_namespace
{
  class base_class
  {
  public:
    base_class & operator=(const base_class &){ 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<some_namespace::class_without_default_ctor>));
  return boost::report_errors();
}

Change History (1)

comment:1 by John Maddock, 7 years ago

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.