summaryrefslogtreecommitdiff
path: root/test/std/utilities/optional/optional.nullopt/nullopt_t.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/utilities/optional/optional.nullopt/nullopt_t.pass.cpp')
-rw-r--r--test/std/utilities/optional/optional.nullopt/nullopt_t.pass.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/std/utilities/optional/optional.nullopt/nullopt_t.pass.cpp b/test/std/utilities/optional/optional.nullopt/nullopt_t.pass.cpp
index 84bb29fabac8d..9b752a665a837 100644
--- a/test/std/utilities/optional/optional.nullopt/nullopt_t.pass.cpp
+++ b/test/std/utilities/optional/optional.nullopt/nullopt_t.pass.cpp
@@ -13,6 +13,11 @@
// struct nullopt_t{see below};
// constexpr nullopt_t nullopt(unspecified);
+// [optional.nullopt]/2:
+// Type nullopt_t shall not have a default constructor or an initializer-list constructor.
+// It shall not be an aggregate and shall be a literal type.
+// Constant nullopt shall be initialized with an argument of literal type.
+
#include <optional>
#include <type_traits>
@@ -29,9 +34,9 @@ test(const nullopt_t&)
int main()
{
- static_assert((std::is_class<nullopt_t>::value), "");
- static_assert((std::is_empty<nullopt_t>::value), "");
- static_assert((std::is_literal_type<nullopt_t>::value), "");
+ static_assert(( std::is_class<nullopt_t>::value), "");
+ static_assert(( std::is_empty<nullopt_t>::value), "");
+ static_assert(( std::is_literal_type<nullopt_t>::value), "");
static_assert((!std::is_default_constructible<nullopt_t>::value), "");
static_assert(test(nullopt) == 3, "");