I don't know if this is a bug, but it's an inconsistency with libstdc++: https://godbolt.org/z/dKGxhndEj