summaryrefslogtreecommitdiffstats
path: root/libcxx/include/ios
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2012-08-26 18:05:35 +0000
committerHoward Hinnant <hhinnant@apple.com>2012-08-26 18:05:35 +0000
commit3320c058bf4e7b827d8546b31881ff043c3a44df (patch)
tree568d5b89e82d2fc210fdbce17c6ba1a007d02787 /libcxx/include/ios
parent2e8e1d42bed49e2a990a242509797fb3b5f66e2c (diff)
downloadbcm5719-llvm-3320c058bf4e7b827d8546b31881ff043c3a44df.tar.gz
bcm5719-llvm-3320c058bf4e7b827d8546b31881ff043c3a44df.zip
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 llvm-svn: 162648
Diffstat (limited to 'libcxx/include/ios')
-rw-r--r--libcxx/include/ios6
1 files changed, 4 insertions, 2 deletions
diff --git a/libcxx/include/ios b/libcxx/include/ios
index e7a50949a85..d02651b8fe6 100644
--- a/libcxx/include/ios
+++ b/libcxx/include/ios
@@ -637,7 +637,7 @@ protected:
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 @@ basic_ios<_CharT, _Traits>::init(basic_streambuf<char_type, traits_type>* __sb)
{
ios_base::init(__sb);
__tie_ = 0;
- __fill_ = widen(' ');
+ __fill_ = traits_type::eof();
}
template <class _CharT, class _Traits>
@@ -731,6 +731,8 @@ inline _LIBCPP_INLINE_VISIBILITY
_CharT
basic_ios<_CharT, _Traits>::fill() const
{
+ if (traits_type::eq_int_type(traits_type::eof(), __fill_))
+ __fill_ = widen(' ');
return __fill_;
}
OpenPOWER on IntegriCloud