re PR libstdc++/64650 (std::experimental::bad_optional_access is not default construc...
authorJonathan Wakely <jwakely@redhat.com>
Tue, 20 Jan 2015 11:51:03 +0000 (11:51 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 20 Jan 2015 11:51:03 +0000 (11:51 +0000)
PR libstdc++/64650
* include/experimental/optional (bad_optional_access): Add default
constructor.
* testsuite/experimental/optional/requirements.cc: Test for default
constructor.

From-SVN: r219889

libstdc++-v3/ChangeLog
libstdc++-v3/include/experimental/optional
libstdc++-v3/testsuite/experimental/optional/requirements.cc

index 3274825b5938d50b59a538d71bec13c9e62ee5b4..0777516053b1a223aaa051297776f77b7c8fd7d2 100644 (file)
@@ -1,3 +1,11 @@
+2015-01-20  Jonathan Wakely  <jwakely@redhat.com>
+
+       PR libstdc++/64650
+       * include/experimental/optional (bad_optional_access): Add default
+       constructor.
+       * testsuite/experimental/optional/requirements.cc: Test for default
+       constructor.
+
 2015-01-20  Jonathan Wakely  <jwakely@redhat.com>
 
        * include/bits/stl_map.h (map::find<>, map::count<>,
index 206b945998a56c900e26dbfc991162f8dc9c183a..811235bfce4717e492201ba1ab51916efb2ebd22 100644 (file)
@@ -110,9 +110,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   class bad_optional_access : public logic_error
   {
   public:
-    // XXX Should not be inline
-    explicit bad_optional_access(const string& __arg) : logic_error(__arg) { }
+    bad_optional_access() : logic_error("bad optional access") { }
 
+    // XXX This constructor is non-standard. Should not be inline
     explicit bad_optional_access(const char* __arg) : logic_error(__arg) { }
 
     virtual ~bad_optional_access() noexcept = default;
index e83975adae26e7b3c64df711bcdbca717c51b474..531b6ca4101ef4a5a09b703d45968454d3714c38 100644 (file)
@@ -23,6 +23,9 @@
 
 #include <tuple>
 
+using std::experimental::bad_optional_access;
+static_assert( std::is_default_constructible<bad_optional_access>::value, "" );
+
 struct trivially_destructible
 {
   trivially_destructible() = delete;