public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/12988] New: Serious problems with 22.2.2.2.2, Stage2, both floats and ints
@ 2003-11-10  8:13 paolo at gcc dot gnu dot org
  2003-11-10  8:13 ` [Bug libstdc++/12988] " paolo at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: paolo at gcc dot gnu dot org @ 2003-11-10  8:13 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-11-26 12:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-10  8:13 [Bug libstdc++/12988] New: Serious problems with 22.2.2.2.2, Stage2, both floats and ints paolo at gcc dot gnu dot org
2003-11-10  8:13 ` [Bug libstdc++/12988] " paolo at gcc dot gnu dot org
2003-11-10  9:16 ` paolo at gcc dot gnu dot org
2003-11-10 10:18 ` paolo at gcc dot gnu dot org
2003-11-12 14:36 ` paolo at gcc dot gnu dot org
2003-11-13  9:39 ` paolo at gcc dot gnu dot org
2003-11-14 12:14 ` paolo at gcc dot gnu dot org
2003-11-17  8:44 ` paolo at gcc dot gnu dot org
2003-11-26 12:45 ` paolo at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).