diff options
author | Eric Fiselier <eric@efcs.ca> | 2016-10-07 21:27:45 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2016-10-07 21:27:45 +0000 |
commit | b18fd9654f67876d366dc7d5577a5c91287d8353 (patch) | |
tree | 19539be19870ba70f2fe9c75d55ef4aaa9e28f4d /libcxx/test/support | |
parent | c50b1a263bcb7edd1d6f2e08cb47a6dcc0562eb7 (diff) | |
download | bcm5719-llvm-b18fd9654f67876d366dc7d5577a5c91287d8353.tar.gz bcm5719-llvm-b18fd9654f67876d366dc7d5577a5c91287d8353.zip |
Fix various issues in std::any and the related tests.
* Fix self-swap. Patch from Casey Carter.
* Remove workarounds and tests for types with deleted move constructors. This
was originally added as part of a LWG proposed resolution that has since
changed.
* Re-apply most recent PR for LWG 2769.
* Re-apply most recent PR for LWG 2754. Specifically fix the SFINAE checks to
use the decayed type.
* Fix tests to allow moved-from std::any's to have a non-empty state. This is
the behavior of MSVC's std::any.
* Various whitespace and test fixes.
llvm-svn: 283606
Diffstat (limited to 'libcxx/test/support')
-rw-r--r-- | libcxx/test/support/any_helpers.h | 61 | ||||
-rw-r--r-- | libcxx/test/support/test_macros.h | 2 |
2 files changed, 2 insertions, 61 deletions
diff --git a/libcxx/test/support/any_helpers.h b/libcxx/test/support/any_helpers.h index a0ff8dbc1f9..ae332d5e0a5 100644 --- a/libcxx/test/support/any_helpers.h +++ b/libcxx/test/support/any_helpers.h @@ -246,67 +246,6 @@ typedef large_type<> large; typedef large_type<1> large1; typedef large_type<2> large2; - -struct deleted_move -{ - static int count; - static int copied; - static int moved; - static int const_copied; - static int non_const_copied; - - static void reset() { - deleted_move::copied = 0; - deleted_move::moved = 0; - deleted_move::const_copied = 0; - deleted_move::non_const_copied = 0; - } - - int value; - - explicit deleted_move(int val = 0) : value(val) { - ++count; - } - explicit deleted_move(int, int val, int) : value(val) { - ++count; - } - deleted_move(std::initializer_list<int> il) : value(*il.begin()) { - ++count; - } - - deleted_move(deleted_move const & other) noexcept { - value = other.value; - ++count; - ++copied; - ++const_copied; - } - - deleted_move(deleted_move& other) noexcept { - value = other.value; - ++count; - ++copied; - ++non_const_copied; - } - - deleted_move(deleted_move && other) = delete; - - ~deleted_move() { - value = -1; - --count; - } - -private: - deleted_move& operator=(deleted_move const&) = delete; - deleted_move& operator=(deleted_move&&) = delete; -}; - -int deleted_move::count = 0; -int deleted_move::copied = 0; -int deleted_move::moved = 0; -int deleted_move::const_copied = 0; -int deleted_move::non_const_copied = 0; - - // The exception type thrown by 'small_throws_on_copy', 'large_throws_on_copy' // and 'throws_on_move'. struct my_any_exception {}; diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h index c751388e5f2..e89127a0ff1 100644 --- a/libcxx/test/support/test_macros.h +++ b/libcxx/test/support/test_macros.h @@ -124,9 +124,11 @@ #if defined(_LIBCPP_VERSION) #define LIBCPP_ASSERT(...) assert(__VA_ARGS__) #define LIBCPP_STATIC_ASSERT(...) static_assert(__VA_ARGS__) +#define LIBCPP_ONLY(...) __VA_ARGS__ #else #define LIBCPP_ASSERT(...) ((void)0) #define LIBCPP_STATIC_ASSERT(...) ((void)0) +#define LIBCPP_ONLY(...) ((void)0) #endif #define ASSERT_NOEXCEPT(...) \ |