https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94545
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Thomas Mercier from comment #2) > I thought that might be the response. Then why does it compile? Because the standard requires it to. > The fact that it does, and produces a result is surprising. > I don't know what the standard says, You should look. It's very explicit: "The default numeric_limits<T> template shall have all members, but with 0 or false values." The standard is clear about what the primary template does, and is clear that there is no specialization for std::byte. std::byte is not a numeric type, why do you expect std::numeric_limits to be meaningful for it? If you want the value with all bits set, use ~std::byte().
