libcpp:
2014-11-29 John Schmerge <jbschmerge@gmail.com>
PR preprocessor/41698
* charset.c (one_utf8_to_utf16): Do not produce surrogate pairs
for 0xffff.
gcc/testsuite:
2014-11-29 Joseph Myers <joseph@codesourcery.com>
PR preprocessor/41698
* gcc/testsuite/g++.dg/cpp/utf16-pr41698-1.C: New test.
From-SVN: r218179
+2014-11-29 Joseph Myers <joseph@codesourcery.com>
+
+ PR preprocessor/41698
+ * gcc/testsuite/g++.dg/cpp/utf16-pr41698-1.C: New test.
+
2014-11-28 Vladimir Makarov <vmakarov@redhat.com>
PR target/64061
--- /dev/null
+// PR 41698: off-by-one error in UTF-16 encoding.
+
+// { dg-do run { target c++11 } }
+
+extern "C" void abort (void);
+extern "C" void exit (int);
+
+int
+main ()
+{
+ char16_t s[] = u"\uffff";
+ if (sizeof s != 2 * sizeof (char16_t) || s[0] != 0xffff || s[1] != 0)
+ abort ();
+ exit (0);
+}
+2014-11-29 John Schmerge <jbschmerge@gmail.com>
+
+ PR preprocessor/41698
+ * charset.c (one_utf8_to_utf16): Do not produce surrogate pairs
+ for 0xffff.
+
2014-11-25 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/60436
return EILSEQ;
}
- if (s < 0xFFFF)
+ if (s <= 0xFFFF)
{
if (*outbytesleftp < 2)
{