diff --git a/libcxx/include/ios b/libcxx/include/ios index 61a05fadd2..d4f15a269a 100644 --- a/libcxx/include/ios +++ b/libcxx/include/ios @@ -524,7 +524,10 @@ template // Attribute 'packed' is used to keep the layout compatible with the previous // definition of the '__fill_' and '_set_' pair in basic_ios on AIX & z/OS. struct _LIBCPP_PACKED _FillHelper { - _LIBCPP_HIDE_FROM_ABI void __init() { __set_ = false; } + _LIBCPP_HIDE_FROM_ABI void __init() { + __set_ = false; + __fill_val_ = _Traits::eof(); + } _LIBCPP_HIDE_FROM_ABI _FillHelper& operator=(typename _Traits::int_type __x) { __set_ = true; __fill_val_ = __x;