This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Small problem in testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-[1-4].cc


Hi Paolo,

There is a small problem in the test cases for PR 11305. After this change:

-  wint_t n1 = fb.sputc(0x20000000);
-  wint_t n2 = fb.sputc(0x40000000);
+  wfilebuf::int_type n1 = fb.sputc(L'i');
+  wfilebuf::int_type n2 = fb.sputc(L'a');

the test cases will no longer detect the presence of the bug.

The problem was that overflow failed to convert characters whose UTF-8
representation is larger than sizeof(wchar_t); 0x20000000 and 0x40000000
are two such characters (6 bytes each) but L'i' and L'a' only require a
single byte each ('i' and 'a').

Regards,
Petur


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]