aboutsummaryrefslogtreecommitdiffstats
path: root/test/libcxx/utilities/optional/optional.object/special_member_gen.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/libcxx/utilities/optional/optional.object/special_member_gen.pass.cpp')
-rw-r--r--test/libcxx/utilities/optional/optional.object/special_member_gen.pass.cpp66
1 files changed, 0 insertions, 66 deletions
diff --git a/test/libcxx/utilities/optional/optional.object/special_member_gen.pass.cpp b/test/libcxx/utilities/optional/optional.object/special_member_gen.pass.cpp
deleted file mode 100644
index 9493d6bb766c..000000000000
--- a/test/libcxx/utilities/optional/optional.object/special_member_gen.pass.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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, c++14
-// <optional>
-
-
-#include <optional>
-#include <type_traits>
-#include <cassert>
-
-#include "archetypes.hpp"
-
-template <class T>
-struct SpecialMemberTest {
- using O = std::optional<T>;
-
- template <template <class> class TestMF>
- static constexpr bool check_same() {
- return TestMF<O>::value == TestMF<T>::value;
- }
-
- // Test that optional inherits the correct trivial/non-trivial members
- static_assert(check_same<std::is_trivially_destructible>(), "");
- static_assert(check_same<std::is_trivially_copyable>(), "");
-};
-
-template <class ...Args> static void sink(Args&&...) {}
-
-template <class ...TestTypes>
-struct DoTestsMetafunction {
- DoTestsMetafunction() { sink(SpecialMemberTest<TestTypes>{}...); }
-};
-
-struct TrivialMoveNonTrivialCopy {
- TrivialMoveNonTrivialCopy() = default;
- TrivialMoveNonTrivialCopy(const TrivialMoveNonTrivialCopy&) {}
- TrivialMoveNonTrivialCopy(TrivialMoveNonTrivialCopy&&) = default;
- TrivialMoveNonTrivialCopy& operator=(const TrivialMoveNonTrivialCopy&) { return *this; }
- TrivialMoveNonTrivialCopy& operator=(TrivialMoveNonTrivialCopy&&) = default;
-};
-
-struct TrivialCopyNonTrivialMove {
- TrivialCopyNonTrivialMove() = default;
- TrivialCopyNonTrivialMove(const TrivialCopyNonTrivialMove&) = default;
- TrivialCopyNonTrivialMove(TrivialCopyNonTrivialMove&&) {}
- TrivialCopyNonTrivialMove& operator=(const TrivialCopyNonTrivialMove&) = default;
- TrivialCopyNonTrivialMove& operator=(TrivialCopyNonTrivialMove&&) { return *this; }
-};
-
-int main()
-{
- sink(
- ImplicitTypes::ApplyTypes<DoTestsMetafunction>{},
- ExplicitTypes::ApplyTypes<DoTestsMetafunction>{},
- NonLiteralTypes::ApplyTypes<DoTestsMetafunction>{},
- NonTrivialTypes::ApplyTypes<DoTestsMetafunction>{},
- DoTestsMetafunction<TrivialMoveNonTrivialCopy, TrivialCopyNonTrivialMove>{}
- );
-}