<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - MSVC Compatibility: Implement intrinsics for P0466R5 - Layout-compatibility and Pointer-interconvertibility Traits"
href="https://bugs.llvm.org/show_bug.cgi?id=48860">48860</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>MSVC Compatibility: Implement intrinsics for P0466R5 - Layout-compatibility and Pointer-interconvertibility Traits
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>11.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++2a
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>mahmoud.g.saleh@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>MSVC recently implemented the following intrinsics needed for P0466R5
Layout-compatibility and Pointer-interconvertibility Traits:
* __builtin_is_layout_compatible
* __builtin_is_pointer_interconvertible_base_of
* __builtin_is_pointer_interconvertible_with_class
* __builtin_is_corresponding_member
MSVC STL is planning to use them in <type_traits> as follows (PR:
<a href="https://github.com/microsoft/STL/pull/1575">https://github.com/microsoft/STL/pull/1575</a>):
// STRUCT TEMPLATE is_layout_compatible
template <class _Ty1, class _Ty2>
struct is_layout_compatible :
bool_constant<__builtin_is_layout_compatible(_Ty1, _Ty2)> {};
template <class _Ty1, class _Ty2>
inline constexpr bool is_layout_compatible_v =
__builtin_is_layout_compatible(_Ty1, _Ty2);
// STRUCT TEMPLATE is_pointer_interconvertible_base_of
template <class _Base, class _Derived>
struct is_pointer_interconvertible_base_of
: bool_constant<__builtin_is_pointer_interconvertible_base_of(_Base,
_Derived)> {};
template <class _Base, class _Derived>
inline constexpr bool is_pointer_interconvertible_base_of_v =
__builtin_is_pointer_interconvertible_base_of(
_Base, _Derived);
// FUNCTION TEMPLATE is_pointer_interconvertible_with_class
template <class _ClassTy, class _MemberTy>
_NODISCARD constexpr bool is_pointer_interconvertible_with_class(_MemberTy
_ClassTy::*_Pm) noexcept {
return __builtin_is_pointer_interconvertible_with_class(_ClassTy, _Pm);
}
// FUNCTION TEMPLATE is_corresponding_member
template <class _ClassTy1, class _ClassTy2, class _MemberTy1, class _MemberTy2>
_NODISCARD constexpr bool is_corresponding_member(_MemberTy1 _ClassTy1::*_Pm1,
_MemberTy2 _ClassTy2::*_Pm2) noexcept {
return __builtin_is_corresponding_member(_ClassTy1, _ClassTy2, _Pm1, _Pm2);</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>