diff --git a/libcxx/include/future b/libcxx/include/future index 48b84cfcb328..9f3780bc7110 100644 --- a/libcxx/include/future +++ b/libcxx/include/future @@ -452,6 +452,8 @@ public: _LIBCPP_INLINE_VISIBILITY const error_code& code() const throw() {return __ec_;} + + virtual ~future_error() _NOEXCEPT; }; class __assoc_sub_state diff --git a/libcxx/include/istream b/libcxx/include/istream index 024f5ce8b032..c56393acbee1 100644 --- a/libcxx/include/istream +++ b/libcxx/include/istream @@ -177,11 +177,13 @@ public: virtual ~basic_istream(); protected: #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + _LIBCPP_INLINE_VISIBILITY basic_istream(basic_istream&& __rhs); #endif // 27.7.1.1.2 Assign/swap: #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + _LIBCPP_INLINE_VISIBILITY basic_istream& operator=(basic_istream&& __rhs); #endif void swap(basic_istream& __rhs); @@ -1504,11 +1506,13 @@ public: virtual ~basic_iostream(); protected: #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + _LIBCPP_INLINE_VISIBILITY basic_iostream(basic_iostream&& __rhs); #endif // assign/swap #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + _LIBCPP_INLINE_VISIBILITY basic_iostream& operator=(basic_iostream&& __rhs); #endif void swap(basic_iostream& __rhs); diff --git a/libcxx/include/ostream b/libcxx/include/ostream index 6730cabe6365..f1a3de9c6df4 100644 --- a/libcxx/include/ostream +++ b/libcxx/include/ostream @@ -154,11 +154,13 @@ public: virtual ~basic_ostream(); protected: #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + _LIBCPP_INLINE_VISIBILITY basic_ostream(basic_ostream&& __rhs); #endif // 27.7.2.3 Assign/swap #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + _LIBCPP_INLINE_VISIBILITY basic_ostream& operator=(basic_ostream&& __rhs); #endif void swap(basic_ostream& __rhs); diff --git a/libcxx/include/string b/libcxx/include/string index 5996c32cfc6c..7d0d53a3d31c 100644 --- a/libcxx/include/string +++ b/libcxx/include/string @@ -3969,54 +3969,6 @@ hash >::operator()( extern template class basic_string; extern template class basic_string; -extern template - enable_if<__is_forward_iterator::value, void>::type - basic_string, allocator >:: - __init(char const*, char const*); - -extern template - enable_if<__is_forward_iterator::value, void>::type - basic_string, allocator >:: - __init(wchar_t const*, wchar_t const*); - -extern template - enable_if<__is_forward_iterator::value, - basic_string, allocator >&>::type - basic_string, allocator >:: - append(char*, char*); - -extern template - enable_if<__is_forward_iterator::value, - basic_string, allocator >&>::type - basic_string, allocator >:: - append(wchar_t*, wchar_t*); - -extern template - enable_if<__is_forward_iterator::value, - string::iterator>::type - string:: - insert(string::const_iterator, char const*, char const*); - -extern template - enable_if<__is_forward_iterator::value, - wstring::iterator>::type - wstring:: - insert(wstring::const_iterator, wchar_t const*, wchar_t const*); - -extern template - enable_if<__is_input_iterator::value, string&>::type - string:: - replace(string::const_iterator, string::const_iterator, char const*, char const*); - -extern template - enable_if<__is_input_iterator::value, wstring&>::type - wstring:: - replace(wstring::const_iterator, wstring::const_iterator, wchar_t const*, wchar_t const*); - -extern template - enable_if<__is_forward_iterator::value, wstring&>::type - wstring::assign(wchar_t*, wchar_t*); - extern template string operator+, allocator >(char const*, string const&); diff --git a/libcxx/include/strstream b/libcxx/include/strstream index 8f4ed0c80ca9..4ff34a55be4d 100644 --- a/libcxx/include/strstream +++ b/libcxx/include/strstream @@ -150,7 +150,9 @@ public: strstreambuf(const unsigned char* __gnext, streamsize __n); #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + _LIBCPP_INLINE_VISIBILITY strstreambuf(strstreambuf&& __rhs); + _LIBCPP_INLINE_VISIBILITY strstreambuf& operator=(strstreambuf&& __rhs); #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES @@ -187,6 +189,43 @@ private: void __init(char* __gnext, streamsize __n, char* __pbeg); }; +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + +inline _LIBCPP_INLINE_VISIBILITY +strstreambuf::strstreambuf(strstreambuf&& __rhs) + : streambuf(__rhs), + __strmode_(__rhs.__strmode_), + __alsize_(__rhs.__alsize_), + __palloc_(__rhs.__palloc_), + __pfree_(__rhs.__pfree_) +{ + __rhs.setg(nullptr, nullptr, nullptr); + __rhs.setp(nullptr, nullptr); +} + +inline _LIBCPP_INLINE_VISIBILITY +strstreambuf& +strstreambuf::operator=(strstreambuf&& __rhs) +{ + if (eback() && (__strmode_ & __allocated) != 0 && (__strmode_ & __frozen) == 0) + { + if (__pfree_) + __pfree_(eback()); + else + delete [] eback(); + } + streambuf::operator=(__rhs); + __strmode_ = __rhs.__strmode_; + __alsize_ = __rhs.__alsize_; + __palloc_ = __rhs.__palloc_; + __pfree_ = __rhs.__pfree_; + __rhs.setg(nullptr, nullptr, nullptr); + __rhs.setp(nullptr, nullptr); + return *this; +} + +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES + class _LIBCPP_VISIBLE istrstream : public istream { diff --git a/libcxx/src/string.cpp b/libcxx/src/string.cpp index 793a58be8c60..7e651a1a8e0a 100644 --- a/libcxx/src/string.cpp +++ b/libcxx/src/string.cpp @@ -19,52 +19,6 @@ template class __basic_string_common; template class basic_string; template class basic_string; -template enable_if<__is_forward_iterator::value, void>::type - basic_string, allocator > - ::__init(char const*, char const*); - -template enable_if<__is_forward_iterator::value, void>::type - basic_string, allocator > - ::__init(wchar_t const*, wchar_t const*); - -template - enable_if<__is_forward_iterator::value, - basic_string, allocator >&>::type - basic_string, allocator >:: - append(char*, char*); - -template - enable_if<__is_forward_iterator::value, - basic_string, allocator >&>::type - basic_string, allocator >:: - append(wchar_t*, wchar_t*); - -template - enable_if<__is_forward_iterator::value, - string::iterator>::type - string:: - insert(string::const_iterator, char const*, char const*); - -template - enable_if<__is_forward_iterator::value, - wstring::iterator>::type - wstring:: - insert(wstring::const_iterator, wchar_t const*, wchar_t const*); - -template - enable_if<__is_input_iterator::value, string&>::type - string:: - replace(string::const_iterator, string::const_iterator, char const*, char const*); - -template - enable_if<__is_input_iterator::value, wstring&>::type - wstring:: - replace(wstring::const_iterator, wstring::const_iterator, wchar_t const*, wchar_t const*); - -template - enable_if<__is_forward_iterator::value, wstring&>::type - wstring::assign(wchar_t*, wchar_t*); - template string operator+, allocator >(char const*, string const&); diff --git a/libcxx/src/strstream.cpp b/libcxx/src/strstream.cpp index c2b7f42aac60..53139509edfa 100644 --- a/libcxx/src/strstream.cpp +++ b/libcxx/src/strstream.cpp @@ -100,41 +100,6 @@ strstreambuf::strstreambuf(const unsigned char* __gnext, streamsize __n) __init((char*)__gnext, __n, nullptr); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - -strstreambuf::strstreambuf(strstreambuf&& __rhs) - : streambuf(__rhs), - __strmode_(__rhs.__strmode_), - __alsize_(__rhs.__alsize_), - __palloc_(__rhs.__palloc_), - __pfree_(__rhs.__pfree_) -{ - __rhs.setg(nullptr, nullptr, nullptr); - __rhs.setp(nullptr, nullptr); -} - -strstreambuf& -strstreambuf::operator=(strstreambuf&& __rhs) -{ - if (eback() && (__strmode_ & __allocated) != 0 && (__strmode_ & __frozen) == 0) - { - if (__pfree_) - __pfree_(eback()); - else - delete [] eback(); - } - streambuf::operator=(__rhs); - __strmode_ = __rhs.__strmode_; - __alsize_ = __rhs.__alsize_; - __palloc_ = __rhs.__palloc_; - __pfree_ = __rhs.__pfree_; - __rhs.setg(nullptr, nullptr, nullptr); - __rhs.setp(nullptr, nullptr); - return *this; -} - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - strstreambuf::~strstreambuf() { if (eback() && (__strmode_ & __allocated) != 0 && (__strmode_ & __frozen) == 0) diff --git a/libcxx/test/utilities/type.index/type.index.members/lt.pass.cpp b/libcxx/test/utilities/type.index/type.index.members/lt.pass.cpp index b442628073b7..c099d1c56378 100644 --- a/libcxx/test/utilities/type.index/type.index.members/lt.pass.cpp +++ b/libcxx/test/utilities/type.index/type.index.members/lt.pass.cpp @@ -28,8 +28,18 @@ int main() assert( (t1 <= t2)); assert(!(t1 > t2)); assert( (t1 >= t2)); - assert(!(t1 < t3)); - assert(!(t1 <= t3)); - assert( (t1 > t3)); - assert( (t1 >= t3)); + if (t1 < t3) + { + assert( (t1 < t3)); + assert( (t1 <= t3)); + assert(!(t1 > t3)); + assert(!(t1 >= t3)); + } + else + { + assert(!(t1 < t3)); + assert(!(t1 <= t3)); + assert( (t1 > t3)); + assert( (t1 >= t3)); + } }