https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94923
Daniel Krügler <daniel.kruegler at googlemail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |daniel.kruegler@googlemail. | |com --- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> --- Corrected code without typos and including the necessary header files: ``` #include <type_traits> #include <optional> #include <cstddef> #include <cstring> static_assert(std::is_trivially_copyable_v<std::optional<char>>); void not_ok() { std::optional<char> value; std::byte buf[128]; std::memcpy(&buf[0], &value, sizeof value); std::memcpy(&value, &buf[0], sizeof value); } int main() {} ```