aboutsummaryrefslogtreecommitdiff
path: root/system/include/libcxx/istream
diff options
context:
space:
mode:
Diffstat (limited to 'system/include/libcxx/istream')
-rw-r--r--system/include/libcxx/istream21
1 files changed, 13 insertions, 8 deletions
diff --git a/system/include/libcxx/istream b/system/include/libcxx/istream
index f3e74c38..14fa4660 100644
--- a/system/include/libcxx/istream
+++ b/system/include/libcxx/istream
@@ -164,7 +164,7 @@ template <class charT, class traits, class T>
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _CharT, class _Traits>
-class _LIBCPP_TYPE_VIS basic_istream
+class _LIBCPP_TYPE_VIS_ONLY basic_istream
: virtual public basic_ios<_CharT, _Traits>
{
streamsize __gc_;
@@ -194,7 +194,7 @@ protected:
public:
// 27.7.1.1.3 Prefix/suffix:
- class _LIBCPP_TYPE_VIS sentry;
+ class _LIBCPP_TYPE_VIS_ONLY sentry;
// 27.7.1.2 Formatted input:
basic_istream& operator>>(basic_istream& (*__pf)(basic_istream&));
@@ -244,7 +244,7 @@ public:
};
template <class _CharT, class _Traits>
-class _LIBCPP_TYPE_VIS basic_istream<_CharT, _Traits>::sentry
+class _LIBCPP_TYPE_VIS_ONLY basic_istream<_CharT, _Traits>::sentry
{
bool __ok_;
@@ -1369,8 +1369,10 @@ basic_istream<_CharT, _Traits>::seekg(pos_type __pos)
this->clear(this->rdstate() & ~ios_base::eofbit);
sentry __sen(*this, true);
if (__sen)
+ {
if (this->rdbuf()->pubseekpos(__pos, ios_base::in) == pos_type(-1))
this->setstate(ios_base::failbit);
+ }
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
@@ -1391,7 +1393,10 @@ basic_istream<_CharT, _Traits>::seekg(off_type __off, ios_base::seekdir __dir)
#endif // _LIBCPP_NO_EXCEPTIONS
sentry __sen(*this, true);
if (__sen)
- this->rdbuf()->pubseekoff(__off, __dir, ios_base::in);
+ {
+ if (this->rdbuf()->pubseekoff(__off, __dir, ios_base::in) == pos_type(-1))
+ this->setstate(ios_base::failbit);
+ }
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
@@ -1451,7 +1456,7 @@ operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x)
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _CharT, class _Traits>
-class _LIBCPP_TYPE_VIS basic_iostream
+class _LIBCPP_TYPE_VIS_ONLY basic_iostream
: public basic_istream<_CharT, _Traits>,
public basic_ostream<_CharT, _Traits>
{
@@ -1702,9 +1707,9 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x)
return __is;
}
-_LIBCPP_EXTERN_TEMPLATE(class basic_istream<char>)
-_LIBCPP_EXTERN_TEMPLATE(class basic_istream<wchar_t>)
-_LIBCPP_EXTERN_TEMPLATE(class basic_iostream<char>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_istream<char>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_istream<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_iostream<char>)
_LIBCPP_END_NAMESPACE_STD