https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122907
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #2)
> Guess it needs to be 0 even if one but not both of _Tp and _Up is bool/const
> bool.
We can just disable __memcpyable_integer for bool:
// Assigning an integer to bool needs to convert all non-zero values to true
// so it is not a memcpyable integer.
// __memcpyable<bool*, bool*> is still true though.
template<>
struct __memcpyable_integer<bool>
{ enum { __width = 0 }; };
__memcpyable<bool*, bool*> and __memcpyable<bool*, const bool*> are still true,
so only heterogeneous operations are affected by changing __memcpyable_integer.