<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/86354>86354</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Inconsistent results for `__is_trivially_relocatable` between Clang and Apple Clang
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dangelog
</td>
</tr>
</table>
<pre>
Testcase from Qt:
```
#include <type_traits>
template <typename T>
inline constexpr bool qIsRelocatable = (std::is_trivially_copyable_v<T> && std::is_trivially_destructible_v<T>)
#if defined(__has_builtin)
#if __has_builtin(__is_trivially_relocatable)
|| __is_trivially_relocatable(T)
#endif
#endif
;
struct Complex2
{
Complex2(Complex2 &&);
};
static_assert(!qIsRelocatable<Complex2>);
```
This works for clang 15.0.0→18.1.0, but the `static_assert` fails for Apple clang version 15.0.0 (clang-1500.0.40.1).
Could someone confirm that this is Apple clang's fault? A class with a user-defined special member (case in point, not even trivially copyable) and which is not marked in any way (e.g. with `[[clang::trivial_abi]]`) should not be detected as trivially relocatalble.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVE2PozgQ_TXOpdTImPB14NCdTKQ57qrvyOAieMfYrF0kk3-_MqTTmdZotBEi2K569arquWQI-mwRG5a_sfy4kwuNzjdK2jMad951Tt2adwzUy4AweDfBX8SyV8aPjH-8C35_tqXItO3NohBYdqDbjC15qSmw7NuzG-E0G0kPKysnhPeHkbZGW4Te2UD4c_bQOWfg3-_hbzSulyQ7E12PwEQVSEVO2asOLXl90dKYW9u7-Rat2gvLDhEYmCiYKOD35goD-aUn_ezCRP2Z1QAKB21RMVG17ShD2y3akLZfrL6cVW37SyD_mcDDEf7fj5UHVh7gT4DV-zMbtEoPv1utaNnbc0O29OHgptngT3E_Kt8-HR5Hovr4vNc0xnyglcfHdyBJum9lCOiJiYqJ9NcWsuzwQN3K_YD5Iqv1_T7qAFfnfwQYnIfeSHuGNE94wtk3waqC1SKtkjThTBygWwhoRGAF_5VIwWGQ2mwgr_Ns8A51QR-0s3fIqK11_yXNOU94sudJykSdwDOng1uMguAmdJtgB-0noFHG4DqADs8hmCgDDHIxxLITvMbNEOCqaQQJS0D_chcZhBl7LQ1MOHXoVy7xEmoLs9OWYoLWEeAFLTzEAB-qZ6IGaRVcR92PkUO0naT_gSpCSHuDq7xFVEzOyUYgFmodBG8b1fWS3KFb2WmWH-NT8AgexjXvCNshKCTsCRXI8ETmQ5mmM5hs1dqpJlN1VssdNmmZpum-rOp8NzYFVgpxUJ2sqn1ZVllVlbVU-zTruhr7eqcbwcWeZ0IIkadZnuTI8yGt6yHveV3ne7bnOEltEmMuU-L8eadDWLCpiizf74zs0IR10Alxb4WIM8830f6lW86B7bnRgcInAmky2Hy3cQ7pQGgJPIbF0KYdVvA_XMaCQ4d0RbRwWOUVG7JpYV3vFm-akWgOsdTixMTprGlcuqR3ExOnyOL-9zJ79w_2xMRpTSowcVrz-i8AAP__TXDJIg">