summaryrefslogtreecommitdiffstats
path: root/libcxx/test/utilities/memory
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2013-04-24 19:44:26 +0000
committerHoward Hinnant <hhinnant@apple.com>2013-04-24 19:44:26 +0000
commit03ec04f9b518e90f5d3da2bac9ccaed5c2628e2c (patch)
tree05a2994ac3aea3ee1f6fc2c4a74cbebf1f3b0ca1 /libcxx/test/utilities/memory
parentbac54a8d5462b1f49ffb74f6af0bb6a5c498f089 (diff)
downloadbcm5719-llvm-03ec04f9b518e90f5d3da2bac9ccaed5c2628e2c.tar.gz
bcm5719-llvm-03ec04f9b518e90f5d3da2bac9ccaed5c2628e2c.zip
default_delete needs a static_assert against void types. I had previously thought that sizeof(void) would take care of this. I was wrong.
llvm-svn: 180213
Diffstat (limited to 'libcxx/test/utilities/memory')
-rw-r--r--libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/void.fail.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/void.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/void.fail.cpp
new file mode 100644
index 00000000000..5d1cf1ff498
--- /dev/null
+++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/void.fail.cpp
@@ -0,0 +1,24 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// default_delete
+
+// Test that default_delete's operator() requires a complete type
+
+#include <memory>
+#include <cassert>
+
+int main()
+{
+ std::default_delete<const void> d;
+ const void* p = 0;
+ d(p);
+}
OpenPOWER on IntegriCloud