aboutsummaryrefslogtreecommitdiff
path: root/include/__mutex_base
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-06-10 13:44:41 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-06-10 13:44:41 +0000
commit74c4bc8d0eddcb4786594f1c6b598094fac43859 (patch)
treeb52af5df113676d27ce94f2a11b1b73f28e1e0a1 /include/__mutex_base
parent7c5c4ef25000522f341d2edb21344a2fe2b881ad (diff)
Notes
Diffstat (limited to 'include/__mutex_base')
-rw-r--r--include/__mutex_base5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/__mutex_base b/include/__mutex_base
index 159acd626618..3b2453f1ba1a 100644
--- a/include/__mutex_base
+++ b/include/__mutex_base
@@ -48,7 +48,7 @@ class _LIBCPP_TYPE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(capability("mutex")) mut
public:
_LIBCPP_INLINE_VISIBILITY
#ifndef _LIBCPP_CXX03_LANG
- constexpr mutex() _NOEXCEPT = default;
+ constexpr mutex() = default;
#else
mutex() _NOEXCEPT {__m_ = (__libcpp_mutex_t)_LIBCPP_MUTEX_INITIALIZER;}
#endif
@@ -67,6 +67,9 @@ public:
_LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__m_;}
};
+static_assert(is_nothrow_default_constructible<mutex>::value,
+ "the default constructor for std::mutex must be nothrow");
+
struct _LIBCPP_TYPE_VIS defer_lock_t {};
struct _LIBCPP_TYPE_VIS try_to_lock_t {};
struct _LIBCPP_TYPE_VIS adopt_lock_t {};