summaryrefslogtreecommitdiffstats
path: root/libcxx/test/utilities/memory/pointer.traits
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/utilities/memory/pointer.traits')
-rw-r--r--libcxx/test/utilities/memory/pointer.traits/difference_type.pass.cpp25
-rw-r--r--libcxx/test/utilities/memory/pointer.traits/element_type.pass.cpp25
-rw-r--r--libcxx/test/utilities/memory/pointer.traits/pointer.pass.cpp32
-rw-r--r--libcxx/test/utilities/memory/pointer.traits/pointer.traits.functions/pointer_to.pass.cpp48
-rw-r--r--libcxx/test/utilities/memory/pointer.traits/pointer.traits.types/difference_type.pass.cpp48
-rw-r--r--libcxx/test/utilities/memory/pointer.traits/pointer.traits.types/element_type.pass.cpp49
-rw-r--r--libcxx/test/utilities/memory/pointer.traits/pointer.traits.types/rebind.pass.cpp69
-rw-r--r--libcxx/test/utilities/memory/pointer.traits/pointer_to.pass.cpp32
-rw-r--r--libcxx/test/utilities/memory/pointer.traits/rebind.pass.cpp29
9 files changed, 0 insertions, 357 deletions
diff --git a/libcxx/test/utilities/memory/pointer.traits/difference_type.pass.cpp b/libcxx/test/utilities/memory/pointer.traits/difference_type.pass.cpp
deleted file mode 100644
index 483c32561e8..00000000000
--- a/libcxx/test/utilities/memory/pointer.traits/difference_type.pass.cpp
+++ /dev/null
@@ -1,25 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// template <class T>
-// struct pointer_traits<T*>
-// {
-// typedef ptrdiff_t difference_type;
-// ...
-// };
-
-#include <memory>
-#include <type_traits>
-
-int main()
-{
- static_assert((std::is_same<std::pointer_traits<double*>::difference_type, std::ptrdiff_t>::value), "");
-}
diff --git a/libcxx/test/utilities/memory/pointer.traits/element_type.pass.cpp b/libcxx/test/utilities/memory/pointer.traits/element_type.pass.cpp
deleted file mode 100644
index 44694fcb013..00000000000
--- a/libcxx/test/utilities/memory/pointer.traits/element_type.pass.cpp
+++ /dev/null
@@ -1,25 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// template <class T>
-// struct pointer_traits<T*>
-// {
-// typedef T element_type;
-// ...
-// };
-
-#include <memory>
-#include <type_traits>
-
-int main()
-{
- static_assert((std::is_same<std::pointer_traits<const short*>::element_type, const short>::value), "");
-}
diff --git a/libcxx/test/utilities/memory/pointer.traits/pointer.pass.cpp b/libcxx/test/utilities/memory/pointer.traits/pointer.pass.cpp
deleted file mode 100644
index 66e90cfcb85..00000000000
--- a/libcxx/test/utilities/memory/pointer.traits/pointer.pass.cpp
+++ /dev/null
@@ -1,32 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// template <class Ptr>
-// struct pointer_traits
-// {
-// typedef Ptr pointer;
-// ...
-// };
-
-#include <memory>
-#include <type_traits>
-
-struct A
-{
- typedef short element_type;
- typedef char difference_type;
-};
-
-int main()
-{
- static_assert((std::is_same<std::pointer_traits<A>::pointer, A>::value), "");
- static_assert((std::is_same<std::pointer_traits<int*>::pointer, int*>::value), "");
-}
diff --git a/libcxx/test/utilities/memory/pointer.traits/pointer.traits.functions/pointer_to.pass.cpp b/libcxx/test/utilities/memory/pointer.traits/pointer.traits.functions/pointer_to.pass.cpp
deleted file mode 100644
index a8ad936c936..00000000000
--- a/libcxx/test/utilities/memory/pointer.traits/pointer.traits.functions/pointer_to.pass.cpp
+++ /dev/null
@@ -1,48 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// template <class Ptr>
-// struct pointer_traits
-// {
-// static pointer pointer_to(<details>);
-// ...
-// };
-
-#include <memory>
-#include <cassert>
-
-template <class T>
-struct A
-{
-private:
- struct nat {};
-public:
- typedef T element_type;
- element_type* t_;
-
- A(element_type* t) : t_(t) {}
-
- static A pointer_to(typename std::conditional<std::is_void<element_type>::value,
- nat, element_type>::type& et)
- {return A(&et);}
-};
-
-int main()
-{
- {
- int i = 0;
- A<int> a = std::pointer_traits<A<int> >::pointer_to(i);
- assert(a.t_ == &i);
- }
- {
- (std::pointer_traits<A<void> >::element_type)0;
- }
-}
diff --git a/libcxx/test/utilities/memory/pointer.traits/pointer.traits.types/difference_type.pass.cpp b/libcxx/test/utilities/memory/pointer.traits/pointer.traits.types/difference_type.pass.cpp
deleted file mode 100644
index 4efe6134242..00000000000
--- a/libcxx/test/utilities/memory/pointer.traits/pointer.traits.types/difference_type.pass.cpp
+++ /dev/null
@@ -1,48 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// template <class Ptr>
-// struct pointer_traits
-// {
-// typedef <details> difference_type;
-// ...
-// };
-
-#include <memory>
-#include <type_traits>
-
-struct A
-{
- typedef short element_type;
- typedef char difference_type;
-};
-
-struct B
-{
- typedef short element_type;
-};
-
-template <class T>
-struct C {};
-
-template <class T>
-struct D
-{
- typedef char difference_type;
-};
-
-int main()
-{
- static_assert((std::is_same<std::pointer_traits<A>::difference_type, char>::value), "");
- static_assert((std::is_same<std::pointer_traits<B>::difference_type, std::ptrdiff_t>::value), "");
- static_assert((std::is_same<std::pointer_traits<C<double> >::difference_type, std::ptrdiff_t>::value), "");
- static_assert((std::is_same<std::pointer_traits<D<int> >::difference_type, char>::value), "");
-}
diff --git a/libcxx/test/utilities/memory/pointer.traits/pointer.traits.types/element_type.pass.cpp b/libcxx/test/utilities/memory/pointer.traits/pointer.traits.types/element_type.pass.cpp
deleted file mode 100644
index 0ee1e8c93a6..00000000000
--- a/libcxx/test/utilities/memory/pointer.traits/pointer.traits.types/element_type.pass.cpp
+++ /dev/null
@@ -1,49 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// template <class Ptr>
-// struct pointer_traits
-// {
-// typedef <details> element_type;
-// ...
-// };
-
-#include <memory>
-#include <type_traits>
-
-struct A
-{
- typedef char element_type;
-};
-
-template <class T>
-struct B
-{
- typedef char element_type;
-};
-
-template <class T>
-struct C
-{
-};
-
-template <class T, class U>
-struct D
-{
-};
-
-int main()
-{
- static_assert((std::is_same<std::pointer_traits<A>::element_type, char>::value), "");
- static_assert((std::is_same<std::pointer_traits<B<int> >::element_type, char>::value), "");
- static_assert((std::is_same<std::pointer_traits<C<int> >::element_type, int>::value), "");
- static_assert((std::is_same<std::pointer_traits<D<double, int> >::element_type, double>::value), "");
-}
diff --git a/libcxx/test/utilities/memory/pointer.traits/pointer.traits.types/rebind.pass.cpp b/libcxx/test/utilities/memory/pointer.traits/pointer.traits.types/rebind.pass.cpp
deleted file mode 100644
index 4a1455c53ef..00000000000
--- a/libcxx/test/utilities/memory/pointer.traits/pointer.traits.types/rebind.pass.cpp
+++ /dev/null
@@ -1,69 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// template <class Ptr>
-// struct pointer_traits
-// {
-// template <class U> using rebind = <details>;
-// ...
-// };
-
-#include <memory>
-#include <type_traits>
-
-template <class T>
-struct A
-{
-};
-
-template <class T> struct B1 {};
-
-template <class T>
-struct B
-{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- template <class U> using rebind = B1<U>;
-#else
- template <class U> struct rebind {typedef B1<U> other;};
-#endif
-};
-
-template <class T, class U>
-struct C
-{
-};
-
-template <class T, class U> struct D1 {};
-
-template <class T, class U>
-struct D
-{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- template <class V> using rebind = D1<V, U>;
-#else
- template <class V> struct rebind {typedef D1<V, U> other;};
-#endif
-};
-
-int main()
-{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- static_assert((std::is_same<std::pointer_traits<A<int*> >::rebind<double*>, A<double*> >::value), "");
- static_assert((std::is_same<std::pointer_traits<B<int> >::rebind<double>, B1<double> >::value), "");
- static_assert((std::is_same<std::pointer_traits<C<char, int> >::rebind<double>, C<double, int> >::value), "");
- static_assert((std::is_same<std::pointer_traits<D<char, int> >::rebind<double>, D1<double, int> >::value), "");
-#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- static_assert((std::is_same<std::pointer_traits<A<int*> >::rebind<double*>::other, A<double*> >::value), "");
- static_assert((std::is_same<std::pointer_traits<B<int> >::rebind<double>::other, B1<double> >::value), "");
- static_assert((std::is_same<std::pointer_traits<C<char, int> >::rebind<double>::other, C<double, int> >::value), "");
- static_assert((std::is_same<std::pointer_traits<D<char, int> >::rebind<double>::other, D1<double, int> >::value), "");
-#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-}
diff --git a/libcxx/test/utilities/memory/pointer.traits/pointer_to.pass.cpp b/libcxx/test/utilities/memory/pointer.traits/pointer_to.pass.cpp
deleted file mode 100644
index fc44d9d77a2..00000000000
--- a/libcxx/test/utilities/memory/pointer.traits/pointer_to.pass.cpp
+++ /dev/null
@@ -1,32 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// template <class T>
-// struct pointer_traits<T*>
-// {
-// static pointer pointer_to(<details>);
-// ...
-// };
-
-#include <memory>
-#include <cassert>
-
-int main()
-{
- {
- int i = 0;
- int* a = std::pointer_traits<int*>::pointer_to(i);
- assert(a == &i);
- }
- {
- (std::pointer_traits<void*>::element_type)0;
- }
-}
diff --git a/libcxx/test/utilities/memory/pointer.traits/rebind.pass.cpp b/libcxx/test/utilities/memory/pointer.traits/rebind.pass.cpp
deleted file mode 100644
index 8716c05f333..00000000000
--- a/libcxx/test/utilities/memory/pointer.traits/rebind.pass.cpp
+++ /dev/null
@@ -1,29 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// template <class T>
-// struct pointer_traits<T*>
-// {
-// template <class U> using rebind = U*;
-// ...
-// };
-
-#include <memory>
-#include <type_traits>
-
-int main()
-{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- static_assert((std::is_same<std::pointer_traits<int*>::rebind<double>, double*>::value), "");
-#else
- static_assert((std::is_same<std::pointer_traits<int*>::rebind<double>::other, double*>::value), "");
-#endif
-}
OpenPOWER on IntegriCloud