From d8e10145f0f1d83fadad9d223202255717a318eb Mon Sep 17 00:00:00 2001 From: Yedidya Feldblum Date: Thu, 24 Sep 2020 18:19:54 -0700 Subject: [PATCH] Fix the Apple LLVM version when disabling tests for Xcode 12 Summary: [Folly] Fix the Apple LLVM version when disabling is-constexpr-default-constructible test expectations over types with non-trivial destructors for Xcode 12. Differential Revision: D23917973 fbshipit-source-id: 1238ec5a53ba0ff73afd67f81ad2868f37196eaa --- folly/Portability.h | 6 ++++++ folly/test/TraitsTest.cpp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/folly/Portability.h b/folly/Portability.h index 2e7eb4ca3f3..570138d78a6 100644 --- a/folly/Portability.h +++ b/folly/Portability.h @@ -454,6 +454,12 @@ constexpr auto kIsWindows = true; constexpr auto kIsWindows = false; #endif +#if defined(__APPLE__) +constexpr auto kIsApple = true; +#else +constexpr auto kIsApple = false; +#endif + constexpr bool kIsAppleIOS = FOLLY_APPLE_IOS == 1; constexpr bool kIsAppleMacOS = FOLLY_APPLE_MACOS == 1; constexpr bool kIsAppleTVOS = FOLLY_APPLE_TVOS == 1; diff --git a/folly/test/TraitsTest.cpp b/folly/test/TraitsTest.cpp index 9145e642e14..7661f8123de 100644 --- a/folly/test/TraitsTest.cpp +++ b/folly/test/TraitsTest.cpp @@ -436,7 +436,7 @@ TEST(Traits, is_constexpr_default_constructible) { // under clang 10, crash: https://bugs.llvm.org/show_bug.cgi?id=47620 // and, with assertions disabled, expectation failures showing compiler // deviation from the language spec - if (kClangVerMajor != 10) { + if (kClangVerMajor != (kIsApple ? 12 : 10)) { struct NonTrivialDtor { ~NonTrivialDtor() {} };