[libcxx] r176822 - This SO question: http://stackoverflow.com/questions/15344402/how-can-i-read-a-0xff-in-a-file-with-libc-istream-iterator/15347225#15347225 highlighted the lack of a cast in the implementation of std::cin. Added. I unfortunately don't have a test case to add to the suite since this bug only shows itself when using std::cin. The current testsuite setup does not have a way a good way to test std::cin.

Howard Hinnant hhinnant at apple.com
Mon Mar 11 12:53:48 PDT 2013


Author: hhinnant
Date: Mon Mar 11 14:53:48 2013
New Revision: 176822

URL: http://llvm.org/viewvc/llvm-project?rev=176822&view=rev
Log:
This SO question:  http://stackoverflow.com/questions/15344402/how-can-i-read-a-0xff-in-a-file-with-libc-istream-iterator/15347225#15347225 highlighted the lack of a cast in the implementation of std::cin.  Added.  I unfortunately don't have a test case to add to the suite since this bug only shows itself when using std::cin.  The current testsuite setup does not have a way a good way to test std::cin.

Modified:
    libcxx/trunk/include/__std_stream

Modified: libcxx/trunk/include/__std_stream
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__std_stream?rev=176822&r1=176821&r2=176822&view=diff
==============================================================================
--- libcxx/trunk/include/__std_stream (original)
+++ libcxx/trunk/include/__std_stream Mon Mar 11 14:53:48 2013
@@ -150,7 +150,7 @@ __stdinbuf<_CharT>::__getchar(bool __con
     {
         for (int __i = __nread; __i > 0;)
         {
-            if (ungetc(__extbuf[--__i], __file_) == EOF)
+            if (ungetc(traits_type::to_int_type(__extbuf[--__i]), __file_) == EOF)
                 return traits_type::eof();
         }
     }





More information about the cfe-commits mailing list