summaryrefslogtreecommitdiffstats
path: root/libcxx/test/utilities/memory/specialized.algorithms/specialized.addressof/addressof.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/utilities/memory/specialized.algorithms/specialized.addressof/addressof.pass.cpp')
-rw-r--r--libcxx/test/utilities/memory/specialized.algorithms/specialized.addressof/addressof.pass.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/libcxx/test/utilities/memory/specialized.algorithms/specialized.addressof/addressof.pass.cpp b/libcxx/test/utilities/memory/specialized.algorithms/specialized.addressof/addressof.pass.cpp
new file mode 100644
index 00000000000..3eb092820e9
--- /dev/null
+++ b/libcxx/test/utilities/memory/specialized.algorithms/specialized.addressof/addressof.pass.cpp
@@ -0,0 +1 @@
+//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <memory> // template <ObjectType T> T* addressof(T& r); #include <memory> #include <cassert> struct A { void operator&() const {} }; int main() { int i; double d; assert(std::addressof(i) == &i); assert(std::addressof(d) == &d); A* tp = new A; const A* ctp = tp; assert(std::addressof(*tp) == tp); assert(std::addressof(*ctp) == tp); delete tp; } \ No newline at end of file
OpenPOWER on IntegriCloud