[cfe-commits] [libcxx] r162648 - /libcxx/trunk/include/ios

Howard Hinnant hhinnant at apple.com
Sun Aug 26 11:05:36 PDT 2012


Author: hhinnant
Date: Sun Aug 26 13:05:35 2012
New Revision: 162648

URL: http://llvm.org/viewvc/llvm-project?rev=162648&view=rev
Log:
Hyeon-bin Jeong:  libc++ fails to create any classes inherit from basic_ios if they
provided char type other than char or wchar_t. It throw exception during
construction, so there is no chance to imbue own ctype.

This fixes http://llvm.org/bugs/show_bug.cgi?id=13698

Modified:
    libcxx/trunk/include/ios

Modified: libcxx/trunk/include/ios
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/ios?rev=162648&r1=162647&r2=162648&view=diff
==============================================================================
--- libcxx/trunk/include/ios (original)
+++ libcxx/trunk/include/ios Sun Aug 26 13:05:35 2012
@@ -637,7 +637,7 @@
     void set_rdbuf(basic_streambuf<char_type, traits_type>* __sb);
 private:
     basic_ostream<char_type, traits_type>* __tie_;
-    char_type __fill_;
+     mutable int_type __fill_;
 };
 
 template <class _CharT, class _Traits>
@@ -659,7 +659,7 @@
 {
     ios_base::init(__sb);
     __tie_ = 0;
-    __fill_ = widen(' ');
+    __fill_ = traits_type::eof();
 }
 
 template <class _CharT, class _Traits>
@@ -731,6 +731,8 @@
 _CharT
 basic_ios<_CharT, _Traits>::fill() const
 {
+    if (traits_type::eq_int_type(traits_type::eof(), __fill_))
+        __fill_ = widen(' ');
     return __fill_;
 }
 





More information about the cfe-commits mailing list