diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2015-10-25 20:12:16 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2015-10-25 20:12:16 +0000 |
commit | 3b72a6ef6343e073529fb7a70c30001af7bb40a7 (patch) | |
tree | 8dbf1805f33da9bd436edecc5ed3b8aa78a6bc53 | |
parent | f04d89bdb4338500b445ab5c74d8d58dbd8bda50 (diff) | |
download | bcm5719-llvm-3b72a6ef6343e073529fb7a70c30001af7bb40a7.tar.gz bcm5719-llvm-3b72a6ef6343e073529fb7a70c30001af7bb40a7.zip |
Fix LWG#2489: mem_fn() should be noexcept
llvm-svn: 251257
-rw-r--r-- | libcxx/include/functional | 4 | ||||
-rw-r--r-- | libcxx/test/std/utilities/function.objects/func.memfn/member_function.pass.cpp | 3 | ||||
-rw-r--r-- | libcxx/www/cxx1z_status.html | 4 |
3 files changed, 7 insertions, 4 deletions
diff --git a/libcxx/include/functional b/libcxx/include/functional index 13286482df5..dbe9b01bbd8 100644 --- a/libcxx/include/functional +++ b/libcxx/include/functional @@ -1249,7 +1249,7 @@ private: type __f_; public: - _LIBCPP_INLINE_VISIBILITY __mem_fn(type __f) : __f_(__f) {} + _LIBCPP_INLINE_VISIBILITY __mem_fn(type __f) _NOEXCEPT : __f_(__f) {} #ifndef _LIBCPP_HAS_NO_VARIADICS // invoke @@ -1364,7 +1364,7 @@ public: template<class _Rp, class _Tp> inline _LIBCPP_INLINE_VISIBILITY __mem_fn<_Rp _Tp::*> -mem_fn(_Rp _Tp::* __pm) +mem_fn(_Rp _Tp::* __pm) _NOEXCEPT { return __mem_fn<_Rp _Tp::*>(__pm); } diff --git a/libcxx/test/std/utilities/function.objects/func.memfn/member_function.pass.cpp b/libcxx/test/std/utilities/function.objects/func.memfn/member_function.pass.cpp index 4096bd81442..f371223ee84 100644 --- a/libcxx/test/std/utilities/function.objects/func.memfn/member_function.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.memfn/member_function.pass.cpp @@ -69,4 +69,7 @@ int main() test0(std::mem_fn(&A::test0)); test1(std::mem_fn(&A::test1)); test2(std::mem_fn(&A::test2)); +#if __has_feature(cxx_noexcept) + static_assert((noexcept(std::mem_fn(&A::test0))), ""); // LWG#2489 +#endif } diff --git a/libcxx/www/cxx1z_status.html b/libcxx/www/cxx1z_status.html index 5f582f1c70e..c12785a436c 100644 --- a/libcxx/www/cxx1z_status.html +++ b/libcxx/www/cxx1z_status.html @@ -175,14 +175,14 @@ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2466">2466</a></td><td><tt>allocator_traits::max_size()</tt> default behavior is incorrect</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2469">2469</a></td><td>Wrong specification of Requires clause of <tt>operator[]</tt> for <tt>map</tt> and <tt>unordered_map</tt></td><td>Kona</td><td></td></tr> <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2473">2473</a></td><td><tt>basic_filebuf</tt>'s relation to C <tt>FILE</tt> semantics</td><td>Kona</td><td>Complete</td></tr> - <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2476">2476</a></td><td><tt>scoped_allocator_adaptor</tt> is not assignable</td><td>Kona</td><td>Patch Ready</td></tr> + <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2476">2476</a></td><td><tt>scoped_allocator_adaptor</tt> is not assignable</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2477">2477</a></td><td>Inconsistency of wordings in <tt>std::vector::erase()</tt> and <tt>std::deque::erase()</tt></td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2483">2483</a></td><td><tt>throw_with_nested()</tt> should use <tt>is_final</tt></td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2484">2484</a></td><td><tt>rethrow_if_nested()</tt> is doubly unimplementable</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2485">2485</a></td><td><tt>get()</tt> should be overloaded for <tt>const tuple&&</tt></td><td>Kona</td><td></td></tr> <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2486">2486</a></td><td><tt>mem_fn()</tt> should be required to use perfect forwarding</td><td>Kona</td><td></td></tr> <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2487">2487</a></td><td><tt>bind()</tt> should be <tt>const</tt>-overloaded, not <i>cv</i>-overloaded</td><td>Kona</td><td>Complete</td></tr> - <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2489">2489</a></td><td><tt>mem_fn()</tt> should be <tt>noexcept</tt></td><td>Kona</td><td>Patch Ready</td></tr> + <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2489">2489</a></td><td><tt>mem_fn()</tt> should be <tt>noexcept</tt></td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2492">2492</a></td><td>Clarify requirements for <tt>comp</tt></td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2495">2495</a></td><td>There is no such thing as an Exception Safety element</td><td>Kona</td><td></td></tr> |