From e1a7b04c5867b87674c0377e14dd7a86bfc694ac Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Thu, 12 Jan 2012 23:37:51 +0000 Subject: [PATCH] Fix http://llvm.org/bugs/show_bug.cgi?id=11752 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@148069 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/fstream | 2 +- include/ostream | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/fstream b/include/fstream index 4456c017..8e1b1fb6 100644 --- a/include/fstream +++ b/include/fstream @@ -549,7 +549,7 @@ basic_filebuf<_CharT, _Traits>::close() { __rt = this; unique_ptr __h(__file_, fclose); - if ((__cm_ & ios_base::out) && sync()) + if (sync()) __rt = 0; if (fclose(__h.release()) == 0) __file_ = 0; diff --git a/include/ostream b/include/ostream index b38326e4..c4e6b38b 100644 --- a/include/ostream +++ b/include/ostream @@ -1218,12 +1218,12 @@ typename enable_if < !is_lvalue_reference<_Stream>::value && is_base_of::value, - _Stream& + _Stream&& >::type operator<<(_Stream&& __os, const _Tp& __x) { __os << __x; - return __os; + return _VSTD::move(__os); } #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES