diff options
-rw-r--r-- | absl/meta/type_traits.h | 10 | ||||
-rw-r--r-- | absl/meta/type_traits_test.cc | 9 |
2 files changed, 15 insertions, 4 deletions
diff --git a/absl/meta/type_traits.h b/absl/meta/type_traits.h index cf71164b..a456ae4f 100644 --- a/absl/meta/type_traits.h +++ b/absl/meta/type_traits.h @@ -501,11 +501,19 @@ using swap_internal::StdSwapIsUnconstrained; // // TODO(b/275003464): remove the opt-out once the bug is fixed. // +// Starting with Xcode 15, the Apple compiler will falsely say a type +// with a user-provided move constructor is trivially relocatable +// (b/324278148). We will opt out without a version check, due to +// the fluidity of Apple versions. +// +// TODO(b/324278148): If all versions we use have the bug fixed, then +// remove the condition. +// // According to https://github.com/abseil/abseil-cpp/issues/1479, this does not // work with NVCC either. #if ABSL_HAVE_BUILTIN(__is_trivially_relocatable) && \ !(defined(__clang__) && (defined(_WIN32) || defined(_WIN64))) && \ - !defined(__NVCC__) + !(defined(__APPLE__)) && !defined(__NVCC__) template <class T> struct is_trivially_relocatable : std::integral_constant<bool, __is_trivially_relocatable(T)> {}; diff --git a/absl/meta/type_traits_test.cc b/absl/meta/type_traits_test.cc index 7412f33d..8f926901 100644 --- a/absl/meta/type_traits_test.cc +++ b/absl/meta/type_traits_test.cc @@ -792,9 +792,12 @@ TEST(TriviallyRelocatable, UserProvidedDestructor) { // TODO(b/275003464): remove the opt-out for Clang on Windows once // __is_trivially_relocatable is used there again. -#if defined(ABSL_HAVE_ATTRIBUTE_TRIVIAL_ABI) && \ - ABSL_HAVE_BUILTIN(__is_trivially_relocatable) && \ - !(defined(__clang__) && (defined(_WIN32) || defined(_WIN64))) +// TODO(b/324278148): remove the opt-out for Apple once +// __is_trivially_relocatable is fixed there. +#if defined(ABSL_HAVE_ATTRIBUTE_TRIVIAL_ABI) && \ + ABSL_HAVE_BUILTIN(__is_trivially_relocatable) && \ + !(defined(__clang__) && (defined(_WIN32) || defined(_WIN64))) && \ + !defined(__APPLE__) // A type marked with the "trivial ABI" attribute is trivially relocatable even // if it has user-provided move/copy constructors and a user-provided // destructor. |