From c912c0ce7c2ca67830a2934505d9441b8d5940e3 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Thu, 4 Jun 2015 02:05:41 +0000 Subject: [PATCH] While applying N4258, I forgot about LWG#2455, which modified the modifications. Correct those - h/t: Howard git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239004 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/string | 10 +--------- include/vector | 20 +++---------------- .../vector.bool/default_noexcept.pass.cpp | 10 ---------- .../vector.cons/construct_default.pass.cpp | 1 + .../vector.cons/default_noexcept.pass.cpp | 10 ---------- .../string.cons/default_noexcept.pass.cpp | 5 ----- 6 files changed, 5 insertions(+), 51 deletions(-) diff --git a/include/string b/include/string index b8cbea317..ac7b30a61 100644 --- a/include/string +++ b/include/string @@ -1321,11 +1321,7 @@ public: static const size_type npos = -1; _LIBCPP_INLINE_VISIBILITY basic_string() -#if _LIBCPP_STD_VER <= 14 _NOEXCEPT_(is_nothrow_default_constructible::value); -#else - _NOEXCEPT; -#endif _LIBCPP_INLINE_VISIBILITY explicit basic_string(const allocator_type& __a) #if _LIBCPP_STD_VER <= 14 @@ -1943,11 +1939,7 @@ basic_string<_CharT, _Traits, _Allocator>::__invalidate_iterators_past(size_type template inline _LIBCPP_INLINE_VISIBILITY basic_string<_CharT, _Traits, _Allocator>::basic_string() -#if _LIBCPP_STD_VER <= 14 - _NOEXCEPT_(is_nothrow_default_constructible::value) -#else - _NOEXCEPT -#endif + _NOEXCEPT_(is_nothrow_default_constructible::value) { #if _LIBCPP_DEBUG_LEVEL >= 2 __get_db()->__insert_c(this); diff --git a/include/vector b/include/vector index ec413fa6e..36001479d 100644 --- a/include/vector +++ b/include/vector @@ -500,12 +500,7 @@ public: "Allocator::value_type must be same type as value_type"); _LIBCPP_INLINE_VISIBILITY - vector() -#if _LIBCPP_STD_VER <= 14 - _NOEXCEPT_(is_nothrow_default_constructible::value) -#else - _NOEXCEPT -#endif + vector() _NOEXCEPT_(is_nothrow_default_constructible::value) { #if _LIBCPP_DEBUG_LEVEL >= 2 __get_db()->__insert_c(this); @@ -2170,12 +2165,7 @@ private: public: _LIBCPP_INLINE_VISIBILITY - vector() -#if _LIBCPP_STD_VER <= 14 - _NOEXCEPT_(is_nothrow_default_constructible::value); -#else - _NOEXCEPT; -#endif + vector() _NOEXCEPT_(is_nothrow_default_constructible::value); _LIBCPP_INLINE_VISIBILITY explicit vector(const allocator_type& __a) #if _LIBCPP_STD_VER <= 14 @@ -2569,11 +2559,7 @@ vector::__construct_at_end(_ForwardIterator __first, _ForwardI template inline _LIBCPP_INLINE_VISIBILITY vector::vector() -#if _LIBCPP_STD_VER <= 14 - _NOEXCEPT_(is_nothrow_default_constructible::value) -#else - _NOEXCEPT -#endif + _NOEXCEPT_(is_nothrow_default_constructible::value) : __begin_(nullptr), __size_(0), __cap_alloc_(0) diff --git a/test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp b/test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp index d0a964808..b94588ead 100644 --- a/test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp +++ b/test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp @@ -39,21 +39,11 @@ int main() } { typedef std::vector> C; -// See N4258 - vector::basic_string() noexcept; -#if TEST_STD_VER <= 14 static_assert(!std::is_nothrow_default_constructible::value, ""); -#else - static_assert( std::is_nothrow_default_constructible::value, ""); -#endif } { typedef std::vector> C; -// See N4258 - vector::basic_string() noexcept; -#if TEST_STD_VER <= 14 static_assert(!std::is_nothrow_default_constructible::value, ""); -#else - static_assert( std::is_nothrow_default_constructible::value, ""); -#endif } #endif } diff --git a/test/std/containers/sequences/vector/vector.cons/construct_default.pass.cpp b/test/std/containers/sequences/vector/vector.cons/construct_default.pass.cpp index 9d757bf57..5e87c07ef 100644 --- a/test/std/containers/sequences/vector/vector.cons/construct_default.pass.cpp +++ b/test/std/containers/sequences/vector/vector.cons/construct_default.pass.cpp @@ -15,6 +15,7 @@ #include #include +#include "test_macros.h" #include "test_allocator.h" #include "../../../NotConstructible.h" #include "../../../stack_allocator.h" diff --git a/test/std/containers/sequences/vector/vector.cons/default_noexcept.pass.cpp b/test/std/containers/sequences/vector/vector.cons/default_noexcept.pass.cpp index e13a5fc0d..60f7b72c9 100644 --- a/test/std/containers/sequences/vector/vector.cons/default_noexcept.pass.cpp +++ b/test/std/containers/sequences/vector/vector.cons/default_noexcept.pass.cpp @@ -41,21 +41,11 @@ int main() } { typedef std::vector> C; -// See N4258 - vector::basic_string() noexcept; -#if TEST_STD_VER <= 14 static_assert(!std::is_nothrow_default_constructible::value, ""); -#else - static_assert( std::is_nothrow_default_constructible::value, ""); -#endif } { typedef std::vector> C; -// See N4258 - vector::basic_string() noexcept; -#if TEST_STD_VER <= 14 static_assert(!std::is_nothrow_default_constructible::value, ""); -#else - static_assert( std::is_nothrow_default_constructible::value, ""); -#endif } #endif } diff --git a/test/std/strings/basic.string/string.cons/default_noexcept.pass.cpp b/test/std/strings/basic.string/string.cons/default_noexcept.pass.cpp index c6137d6b5..af117103d 100644 --- a/test/std/strings/basic.string/string.cons/default_noexcept.pass.cpp +++ b/test/std/strings/basic.string/string.cons/default_noexcept.pass.cpp @@ -40,12 +40,7 @@ int main() } { typedef std::basic_string, some_alloc> C; -// See N4258 - basic_string::basic_string() noexcept; -#if TEST_STD_VER <= 14 static_assert(!std::is_nothrow_default_constructible::value, ""); -#else - static_assert( std::is_nothrow_default_constructible::value, ""); -#endif } #endif }