File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
libcxx/include/__type_traits Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,17 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2222
2323// A type is trivially relocatable if a move construct + destroy of the original object is equivalent to
2424// `memcpy(dst, src, sizeof(T))`.
25+ //
26+ // Note that we don't use the __is_trivially_relocatable Clang builtin right now because it does not
27+ // implement the semantics of any current or future trivial relocation proposal and it can lead to
28+ // incorrect optimizations on some platforms (Windows) and supported compilers (AppleClang).
29+ #if __has_builtin(__is_trivially_relocatable) && 0
30+ template <class _Tp , class = void >
31+ struct __libcpp_is_trivially_relocatable : integral_constant<bool , __is_trivially_relocatable(_Tp)> {};
32+ #else
2533template <class _Tp , class = void >
2634struct __libcpp_is_trivially_relocatable : is_trivially_copyable<_Tp> {};
35+ #endif
2736
2837template <class _Tp >
2938struct __libcpp_is_trivially_relocatable <_Tp,
You can’t perform that action at this time.
0 commit comments