https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69944

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I don't think your assumptions about the program are guaranteed by the
standard. I don't think it's guaranteed that there is a 1:1 mapping between
calls to widen(x) and do_widen(x).

On the first call to fac.widen the library uses the 3-argument form of do_widen
to populate a cache of all 256 char values. Your override of the 3-argument
do_widen fails to meet the contract, and does not widen all the characters in
the range [first1, last1). 

This means that the cache is not correctly populated, and so the second call to
fac.widen returns a bad value.

Reply via email to