[Bug libstdc++/122907] [15/16 Regression] std::copy incorrectly uses memcpy when copying from signed or unsigned char buffer to bool buffer

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Dec 1 11:27:10 GMT 2025


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122907

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
> To bool is a problem unless it is from a bool.
> From bool is always safe to use.

Yes, we could continue to use memcpy for std::copy from bool to
signed/unsigned/plain char, but losing that optimization probably isn't a big
deal.


More information about the Gcc-bugs mailing list