summaryrefslogtreecommitdiffstats
path: root/libcxx/test/utilities/memory/pointer.traits/pointer_to.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/utilities/memory/pointer.traits/pointer_to.pass.cpp')
-rw-r--r--libcxx/test/utilities/memory/pointer.traits/pointer_to.pass.cpp33
1 files changed, 32 insertions, 1 deletions
diff --git a/libcxx/test/utilities/memory/pointer.traits/pointer_to.pass.cpp b/libcxx/test/utilities/memory/pointer.traits/pointer_to.pass.cpp
index 42fd9300b7d..557bf36b976 100644
--- a/libcxx/test/utilities/memory/pointer.traits/pointer_to.pass.cpp
+++ b/libcxx/test/utilities/memory/pointer.traits/pointer_to.pass.cpp
@@ -1 +1,32 @@
-//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. 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; } } \ No newline at end of file
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. 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;
+ }
+}
OpenPOWER on IntegriCloud