]> git.saurik.com Git - apple/xnu.git/blobdiff - tests/safe_allocation_src/ctor.copy.cpp
xnu-7195.50.7.100.1.tar.gz
[apple/xnu.git] / tests / safe_allocation_src / ctor.copy.cpp
diff --git a/tests/safe_allocation_src/ctor.copy.cpp b/tests/safe_allocation_src/ctor.copy.cpp
new file mode 100644 (file)
index 0000000..1e2936c
--- /dev/null
@@ -0,0 +1,18 @@
+//
+// Tests for
+//  safe_allocation(safe_allocation const&) = delete;
+//
+
+#include <libkern/c++/safe_allocation.h>
+#include <type_traits>
+#include <darwintest.h>
+#include "test_utils.h"
+
+struct T {
+       int i;
+};
+
+T_DECL(ctor_copy, "safe_allocation.ctor.copy") {
+       static_assert(!std::is_copy_constructible_v<test_safe_allocation<T> >);
+       T_PASS("safe_allocation.ctor.copy passed");
+}