summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/function.objects/refwrap
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2017-05-12 03:38:28 +0000
committerEric Fiselier <eric@efcs.ca>2017-05-12 03:38:28 +0000
commit25b9b60dd6ea41b66f8f7490b55f7087bb737e81 (patch)
treee76d4c2da0452174fdf2411df1be04afc2838e54 /libcxx/test/std/utilities/function.objects/refwrap
parent5b8ab693ab4ae5dd4e53feb5bf65873a1ea428f0 (diff)
downloadbcm5719-llvm-25b9b60dd6ea41b66f8f7490b55f7087bb737e81.tar.gz
bcm5719-llvm-25b9b60dd6ea41b66f8f7490b55f7087bb737e81.zip
Cleanup test issues reported by STL @ Microsoft.
This patch cleans up a number of issues reported by STL, including: 1) Fix duplicate is_convertible test. 2) Move non-standard reference_wrapper tests under test/libcxx 3) Fix assumption that sizeof(wchar_t) == 32 in the codecvt and wstring_convert tests. llvm-svn: 302870
Diffstat (limited to 'libcxx/test/std/utilities/function.objects/refwrap')
-rw-r--r--libcxx/test/std/utilities/function.objects/refwrap/binary.pass.cpp80
-rw-r--r--libcxx/test/std/utilities/function.objects/refwrap/unary.pass.cpp78
2 files changed, 0 insertions, 158 deletions
diff --git a/libcxx/test/std/utilities/function.objects/refwrap/binary.pass.cpp b/libcxx/test/std/utilities/function.objects/refwrap/binary.pass.cpp
deleted file mode 100644
index 579e81fe69e..00000000000
--- a/libcxx/test/std/utilities/function.objects/refwrap/binary.pass.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// reference_wrapper
-
-// check for deriving from binary_function
-
-#include <functional>
-#include <type_traits>
-
-class functor1
- : public std::unary_function<int, char>
-{
-};
-
-class functor2
- : public std::binary_function<char, int, double>
-{
-};
-
-class functor3
- : public std::unary_function<int, int>,
- public std::binary_function<char, int, double>
-{
-public:
- typedef float result_type;
-};
-
-class functor4
- : public std::unary_function<int, int>,
- public std::binary_function<char, int, double>
-{
-public:
-};
-
-struct C
-{
- typedef int argument_type;
- typedef int result_type;
-};
-
-int main()
-{
- static_assert((!std::is_base_of<std::binary_function<int, char, int>,
- std::reference_wrapper<functor1> >::value), "");
- static_assert((std::is_base_of<std::binary_function<char, int, double>,
- std::reference_wrapper<functor2> >::value), "");
- static_assert((std::is_base_of<std::binary_function<char, int, double>,
- std::reference_wrapper<functor3> >::value), "");
- static_assert((std::is_base_of<std::binary_function<char, int, double>,
- std::reference_wrapper<functor4> >::value), "");
- static_assert((!std::is_base_of<std::binary_function<int, int, int>,
- std::reference_wrapper<C> >::value), "");
- static_assert((!std::is_base_of<std::binary_function<int, int, float>,
- std::reference_wrapper<float ()> >::value), "");
- static_assert((!std::is_base_of<std::binary_function<int, int, float>,
- std::reference_wrapper<float (int)> >::value), "");
- static_assert((std::is_base_of<std::binary_function<int, int, float>,
- std::reference_wrapper<float (int, int)> >::value), "");
- static_assert((!std::is_base_of<std::binary_function<int, int, float>,
- std::reference_wrapper<float(*)()> >::value), "");
- static_assert((!std::is_base_of<std::binary_function<int, int, float>,
- std::reference_wrapper<float(*)(int)> >::value), "");
- static_assert((std::is_base_of<std::binary_function<int, int, float>,
- std::reference_wrapper<float(*)(int, int)> >::value), "");
- static_assert((!std::is_base_of<std::binary_function<C*, int, float>,
- std::reference_wrapper<float(C::*)()> >::value), "");
- static_assert((std::is_base_of<std::binary_function<C*, int, float>,
- std::reference_wrapper<float(C::*)(int)> >::value), "");
- static_assert((std::is_base_of<std::binary_function<const volatile C*, int, float>,
- std::reference_wrapper<float(C::*)(int) const volatile> >::value), "");
-}
diff --git a/libcxx/test/std/utilities/function.objects/refwrap/unary.pass.cpp b/libcxx/test/std/utilities/function.objects/refwrap/unary.pass.cpp
deleted file mode 100644
index 528a8f327d9..00000000000
--- a/libcxx/test/std/utilities/function.objects/refwrap/unary.pass.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// reference_wrapper
-
-// check for deriving from unary_function
-
-#include <functional>
-#include <type_traits>
-
-class functor1
- : public std::unary_function<int, char>
-{
-};
-
-class functor2
- : public std::binary_function<char, int, double>
-{
-};
-
-class functor3
- : public std::unary_function<int, int>,
- public std::binary_function<char, int, double>
-{
-public:
- typedef float result_type;
-};
-
-class functor4
- : public std::unary_function<int, int>,
- public std::binary_function<char, int, double>
-{
-public:
-};
-
-struct C
-{
- typedef int argument_type;
- typedef int result_type;
-};
-
-int main()
-{
- static_assert((std::is_base_of<std::unary_function<int, char>,
- std::reference_wrapper<functor1> >::value), "");
- static_assert((!std::is_base_of<std::unary_function<char, int>,
- std::reference_wrapper<functor2> >::value), "");
- static_assert((std::is_base_of<std::unary_function<int, int>,
- std::reference_wrapper<functor3> >::value), "");
- static_assert((std::is_base_of<std::unary_function<int, int>,
- std::reference_wrapper<functor4> >::value), "");
- static_assert((!std::is_base_of<std::unary_function<int, int>,
- std::reference_wrapper<C> >::value), "");
- static_assert((!std::is_base_of<std::unary_function<int, float>,
- std::reference_wrapper<float(*)()> >::value), "");
- static_assert((std::is_base_of<std::unary_function<int, float>,
- std::reference_wrapper<float (int)> >::value), "");
- static_assert((!std::is_base_of<std::unary_function<int, float>,
- std::reference_wrapper<float (int, int)> >::value), "");
- static_assert((std::is_base_of<std::unary_function<int, float>,
- std::reference_wrapper<float(*)(int)> >::value), "");
- static_assert((!std::is_base_of<std::unary_function<int, float>,
- std::reference_wrapper<float(*)(int, int)> >::value), "");
- static_assert((std::is_base_of<std::unary_function<C*, float>,
- std::reference_wrapper<float(C::*)()> >::value), "");
- static_assert((std::is_base_of<std::unary_function<const volatile C*, float>,
- std::reference_wrapper<float(C::*)() const volatile> >::value), "");
- static_assert((!std::is_base_of<std::unary_function<C*, float>,
- std::reference_wrapper<float(C::*)(int)> >::value), "");
-}
OpenPOWER on IntegriCloud