From da51b957c0d420d9615d3761015f9a0a5562cd3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 22 Mar 2024 11:14:25 +0000 Subject: [PATCH] Revert "QTypeInfo: add detection for Clang's __is_trivially_relocatable" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f4bac3ca173be9f219099c04e76d6d62c4d0e19e. It broke builds with Xcode 15 Change-Id: Iee232658ede3dfb09d65f3f6a95410c069941421 Reviewed-by: Tor Arne Vestbø --- src/corelib/global/qtypeinfo.h | 8 +------- tests/auto/corelib/global/qglobal/tst_qglobal.cpp | 14 -------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h index 473854f230c..9b2119da1df 100644 --- a/src/corelib/global/qtypeinfo.h +++ b/src/corelib/global/qtypeinfo.h @@ -23,13 +23,7 @@ class QDebug; namespace QtPrivate { template -inline constexpr bool qIsRelocatable = (std::is_trivially_copyable_v && std::is_trivially_destructible_v) -#if defined(__has_builtin) -#if __has_builtin(__is_trivially_relocatable) - || __is_trivially_relocatable(T) -#endif -#endif - ; +inline constexpr bool qIsRelocatable = std::is_trivially_copyable_v && std::is_trivially_destructible_v; // Denotes types that are trivially default constructible, and for which // value-initialization can be achieved by filling their storage with 0 bits. diff --git a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp index 524212e9333..1a19048bbe7 100644 --- a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp +++ b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp @@ -930,20 +930,6 @@ struct Trivial1 static_assert(!QTypeInfo::isComplex); static_assert(QTypeInfo::isRelocatable); -#if defined(__has_builtin) -#if __has_builtin(__is_trivially_relocatable) && __has_attribute(trivial_abi) -struct [[clang::trivial_abi]] TrivialAbi1 -{ - ~TrivialAbi1(); - TrivialAbi1(TrivialAbi1 &&); -}; -static_assert(__has_builtin(__is_trivially_relocatable)); -static_assert(__is_trivially_relocatable(TrivialAbi1)); -static_assert(QTypeInfo::isComplex); -static_assert(QTypeInfo::isRelocatable); -#endif -#endif - QT_END_NAMESPACE QTEST_APPLESS_MAIN(tst_QGlobal)