[PATCH] PR libstdc++/80624 satisfy invariant for char_traits<char16_t>::eof()

Stephan Bergmann via libstdc++ libstdc++@gcc.gnu.org
Mon May 8 11:37:00 GMT 2017


On 05/08/2017 12:19 PM, Jonathan Wakely via libstdc++ wrote:
> Changing the semantics of to_int_type for U+FFFF is far less likely to
> affect any ABIs (it's a constexpr function so it's possible somebody
> is using the value of to_int_type(char_type(-1)) as a template
> argument, but it seems unlikely. It's a much smaller change, "allowed"
> by http://www.unicode.org/faq/private_use.html#nonchar10 and it only
> affects a noncharacter that is not intended for interchange anyway.

I'm not convinced that a C++ implementation should be allowed to rewrite 
U+FFFF -> U+FFFD in this manner.  Noncharacters not being suitable for 
interchange IMO doesn't imply that an application shouldn't be able to 
write them out and read them back in.  (And 
<http://www.unicode.org/versions/corrigendum9.html> "Corrigendum #9: 
Clarification About Noncharacters" seems to support that view.)

To me, it feels like this change is not an improvement over keeping 
living with the current defect.



More information about the Libstdc++ mailing list