Don't check that std::pair is trivially copyable on FreeBSD
authorDimitry Andric <dimitry@andric.com>
Sat, 3 Apr 2021 10:20:13 +0000 (12:20 +0200)
committerDimitry Andric <dimitry@andric.com>
Sun, 4 Apr 2021 11:13:56 +0000 (13:13 +0200)
As FreeBSD already used libc++ before it changed its ABI, we still use
the non-trivially copyable version of std::pair, which used to be
exposed via `_LIBCPP_TRIVIAL_PAIR_COPY_CTOR`, but more recently via
`_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR`.

Reviewed By: serge-sans-paille

Differential Revision: https://reviews.llvm.org/D99834

llvm/unittests/Support/TypeTraitsTest.cpp

index 15a38b8..cd78f09 100644 (file)
@@ -110,7 +110,9 @@ TEST(Triviality, ADT) {
   TrivialityTester<llvm::SmallString<8>, false, false>();
 
   TrivialityTester<std::function<int()>, false, false>();
+#if !defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
   TrivialityTester<std::pair<int, bool>, true, true>();
+#endif
   TrivialityTester<llvm::unique_function<int()>, false, false>();
   TrivialityTester<llvm::StringRef, true, true>();
   TrivialityTester<llvm::ArrayRef<int>, true, true>();