[Bug libstdc++/12988] New: Serious problems with 22.2.2.2.2, Stage2, both floats and ints
paolo at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Mon Nov 10 08:13:00 GMT 2003
Consider this small testcase from Martin Sebor:
#include <iostream>
#include <locale>
struct Ctype: std::ctype<char>
{
char do_widen(char c) const {
return 'A' + c % 26;
}
};
int main()
{
std::locale loc(std::locale::classic(), new Ctype);
loc = std::cout.imbue(loc);
std::cout << 123 << '\n'; // (double)123
std::cout.imbue(loc);
}
It doesn't print ABC as expected but instead 123, both for integer
and float types due to serious problems in _M_insert_float and
_M_insert_int:
1- In _M_insert_int Stage2 is *completely* missing!
2- In _M_insert_float Stage2 uses the range version of widen instead
of the single char version, prescribed by the standard.
Sigh!
--
Summary: Serious problems with 22.2.2.2.2, Stage2, both floats
and ints
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libstdc++
AssignedTo: paolo at gcc dot gnu dot org
ReportedBy: paolo at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: Any
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12988
More information about the Gcc-bugs
mailing list