https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102958
--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Jonathan Wakely from comment #8) > Fixing the underlying optimization issue might be nice, but I don't see any > reason why std::char_traits<char8_t>::length can't simply use strlen. We'd > only need to cast it to const char* (which is fine because we won't do that > for constexpr evaluation). > > char(0) and char8_t(0) have the same bits after all. Patch posted for that: https://gcc.gnu.org/pipermail/gcc-patches/2024-August/659183.html