summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ADT/OptionalTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/ADT/OptionalTest.cpp')
-rw-r--r--llvm/unittests/ADT/OptionalTest.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/unittests/ADT/OptionalTest.cpp b/llvm/unittests/ADT/OptionalTest.cpp
index 46d4fe0780c..a9a37bf820d 100644
--- a/llvm/unittests/ADT/OptionalTest.cpp
+++ b/llvm/unittests/ADT/OptionalTest.cpp
@@ -518,5 +518,14 @@ TEST_F(OptionalTest, OperatorGreaterEqual) {
CheckRelation<GreaterEqual>(InequalityLhs, InequalityRhs, !IsLess);
}
+#if (__has_feature(is_trivially_copyable) && defined(_LIBCPP_VERSION)) || \
+ (defined(__GNUC__) && __GNUC__ >= 5)
+static_assert(std::is_trivially_copyable<Optional<int>>::value,
+ "Should be trivially copyable");
+static_assert(
+ !std::is_trivially_copyable<Optional<NonDefaultConstructible>>::value,
+ "Shouldn't be trivially copyable");
+#endif
+
} // end anonymous namespace
OpenPOWER on IntegriCloud