aboutsummaryrefslogtreecommitdiff
path: root/test/std/experimental/any/any.class/any.cons/default.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/experimental/any/any.class/any.cons/default.pass.cpp')
-rw-r--r--test/std/experimental/any/any.class/any.cons/default.pass.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/std/experimental/any/any.class/any.cons/default.pass.cpp b/test/std/experimental/any/any.class/any.cons/default.pass.cpp
new file mode 100644
index 000000000000..b52c83fc3881
--- /dev/null
+++ b/test/std/experimental/any/any.class/any.cons/default.pass.cpp
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11
+
+// <experimental/any>
+
+// any() noexcept;
+
+#include <experimental/any>
+#include <type_traits>
+#include <cassert>
+
+#include "any_helpers.h"
+#include "count_new.hpp"
+
+
+int main()
+{
+ using std::experimental::any;
+ {
+ static_assert(
+ std::is_nothrow_default_constructible<any>::value
+ , "Must be default constructible"
+ );
+ }
+ {
+ DisableAllocationGuard g; ((void)g);
+ any const a;
+ assertEmpty(a);
+ }
+}