Quellcode durchsuchen

Fixing up some ABI issues

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134639 91177308-0d34-0410-b5e6-96231b3b80d8
Howard Hinnant vor 14 Jahren
Ursprung
Commit
ac6de546bd
8 geänderte Dateien mit 61 neuen und 133 gelöschten Zeilen
  1. 2 0
      include/future
  2. 4 0
      include/istream
  3. 2 0
      include/ostream
  4. 0 48
      include/string
  5. 39 0
      include/strstream
  6. 0 46
      src/string.cpp
  7. 0 35
      src/strstream.cpp
  8. 14 4
      test/utilities/type.index/type.index.members/lt.pass.cpp

+ 2 - 0
include/future

@@ -452,6 +452,8 @@ public:
 
 
     _LIBCPP_INLINE_VISIBILITY
     _LIBCPP_INLINE_VISIBILITY
     const error_code& code() const throw() {return __ec_;}
     const error_code& code() const throw() {return __ec_;}
+
+    virtual ~future_error() _NOEXCEPT;
 };
 };
 
 
 class __assoc_sub_state
 class __assoc_sub_state

+ 4 - 0
include/istream

@@ -177,11 +177,13 @@ public:
     virtual ~basic_istream();
     virtual ~basic_istream();
 protected:
 protected:
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY
     basic_istream(basic_istream&& __rhs);
     basic_istream(basic_istream&& __rhs);
 #endif
 #endif
 
 
     // 27.7.1.1.2 Assign/swap:
     // 27.7.1.1.2 Assign/swap:
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY
     basic_istream& operator=(basic_istream&& __rhs);
     basic_istream& operator=(basic_istream&& __rhs);
 #endif
 #endif
     void swap(basic_istream& __rhs);
     void swap(basic_istream& __rhs);
@@ -1504,11 +1506,13 @@ public:
     virtual ~basic_iostream();
     virtual ~basic_iostream();
 protected:
 protected:
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY
     basic_iostream(basic_iostream&& __rhs);
     basic_iostream(basic_iostream&& __rhs);
 #endif
 #endif
 
 
     // assign/swap
     // assign/swap
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY
     basic_iostream& operator=(basic_iostream&& __rhs);
     basic_iostream& operator=(basic_iostream&& __rhs);
 #endif
 #endif
     void swap(basic_iostream& __rhs);
     void swap(basic_iostream& __rhs);

+ 2 - 0
include/ostream

@@ -154,11 +154,13 @@ public:
     virtual ~basic_ostream();
     virtual ~basic_ostream();
 protected:
 protected:
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY
     basic_ostream(basic_ostream&& __rhs);
     basic_ostream(basic_ostream&& __rhs);
 #endif
 #endif
 
 
     // 27.7.2.3 Assign/swap
     // 27.7.2.3 Assign/swap
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY
     basic_ostream& operator=(basic_ostream&& __rhs);
     basic_ostream& operator=(basic_ostream&& __rhs);
 #endif
 #endif
     void swap(basic_ostream& __rhs);
     void swap(basic_ostream& __rhs);

+ 0 - 48
include/string

@@ -3969,54 +3969,6 @@ hash<basic_string<_CharT, _Traits, _Allocator> >::operator()(
 extern template class basic_string<char>;
 extern template class basic_string<char>;
 extern template class basic_string<wchar_t>;
 extern template class basic_string<wchar_t>;
 
 
-extern template
-    enable_if<__is_forward_iterator<char const*>::value, void>::type
-    basic_string<char, char_traits<char>, allocator<char> >::
-    __init<char const*>(char const*, char const*);
-
-extern template
-    enable_if<__is_forward_iterator<wchar_t const*>::value, void>::type
-    basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >::
-    __init<wchar_t const*>(wchar_t const*, wchar_t const*);
-
-extern template
-    enable_if<__is_forward_iterator<char*>::value,
-    basic_string<char, char_traits<char>, allocator<char> >&>::type
-    basic_string<char, char_traits<char>, allocator<char> >::
-    append<char*>(char*, char*);
-
-extern template
-    enable_if<__is_forward_iterator<wchar_t*>::value,
-    basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&>::type
-    basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >::
-    append<wchar_t*>(wchar_t*, wchar_t*);
-
-extern template
-    enable_if<__is_forward_iterator<char const*>::value,
-    string::iterator>::type
-    string::
-    insert<char const*>(string::const_iterator, char const*, char const*);
-
-extern template
-    enable_if<__is_forward_iterator<wchar_t const*>::value,
-    wstring::iterator>::type
-    wstring::
-    insert<wchar_t const*>(wstring::const_iterator, wchar_t const*, wchar_t const*);
-
-extern template
-    enable_if<__is_input_iterator<char const*>::value, string&>::type
-    string::
-    replace<char const*>(string::const_iterator, string::const_iterator, char const*, char const*);
-
-extern template
-    enable_if<__is_input_iterator<wchar_t const*>::value, wstring&>::type
-    wstring::
-    replace<wchar_t const*>(wstring::const_iterator, wstring::const_iterator, wchar_t const*, wchar_t const*);
-
-extern template
-    enable_if<__is_forward_iterator<wchar_t*>::value, wstring&>::type
-    wstring::assign<wchar_t*>(wchar_t*, wchar_t*);
-
 extern template
 extern template
     string
     string
     operator+<char, char_traits<char>, allocator<char> >(char const*, string const&);
     operator+<char, char_traits<char>, allocator<char> >(char const*, string const&);

+ 39 - 0
include/strstream

@@ -150,7 +150,9 @@ public:
     strstreambuf(const unsigned char* __gnext, streamsize __n);
     strstreambuf(const unsigned char* __gnext, streamsize __n);
 
 
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY
     strstreambuf(strstreambuf&& __rhs);
     strstreambuf(strstreambuf&& __rhs);
+    _LIBCPP_INLINE_VISIBILITY
     strstreambuf& operator=(strstreambuf&& __rhs);
     strstreambuf& operator=(strstreambuf&& __rhs);
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 
@@ -187,6 +189,43 @@ private:
     void __init(char* __gnext, streamsize __n, char* __pbeg);
     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
 class _LIBCPP_VISIBLE istrstream
     : public istream
     : public istream
 {
 {

+ 0 - 46
src/string.cpp

@@ -19,52 +19,6 @@ template class __basic_string_common<true>;
 template class basic_string<char>;
 template class basic_string<char>;
 template class basic_string<wchar_t>;
 template class basic_string<wchar_t>;
 
 
-template enable_if<__is_forward_iterator<char const*>::value, void>::type
-    basic_string<char, char_traits<char>, allocator<char> >
-    ::__init<char const*>(char const*, char const*);
-
-template enable_if<__is_forward_iterator<wchar_t const*>::value, void>::type
-    basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >
-    ::__init<wchar_t const*>(wchar_t const*, wchar_t const*);
-
-template
-    enable_if<__is_forward_iterator<char*>::value,
-    basic_string<char, char_traits<char>, allocator<char> >&>::type
-    basic_string<char, char_traits<char>, allocator<char> >::
-    append<char*>(char*, char*);
-
-template
-    enable_if<__is_forward_iterator<wchar_t*>::value,
-    basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&>::type
-    basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >::
-    append<wchar_t*>(wchar_t*, wchar_t*);
-
-template
-    enable_if<__is_forward_iterator<char const*>::value,
-    string::iterator>::type
-    string::
-    insert<char const*>(string::const_iterator, char const*, char const*);
-
-template
-    enable_if<__is_forward_iterator<wchar_t const*>::value,
-    wstring::iterator>::type
-    wstring::
-    insert<wchar_t const*>(wstring::const_iterator, wchar_t const*, wchar_t const*);
-
-template
-    enable_if<__is_input_iterator<char const*>::value, string&>::type
-    string::
-    replace<char const*>(string::const_iterator, string::const_iterator, char const*, char const*);
-
-template
-    enable_if<__is_input_iterator<wchar_t const*>::value, wstring&>::type
-    wstring::
-    replace<wchar_t const*>(wstring::const_iterator, wstring::const_iterator, wchar_t const*, wchar_t const*);
-
-template
-    enable_if<__is_forward_iterator<wchar_t*>::value, wstring&>::type
-    wstring::assign<wchar_t*>(wchar_t*, wchar_t*);
-
 template
 template
     string
     string
     operator+<char, char_traits<char>, allocator<char> >(char const*, string const&);
     operator+<char, char_traits<char>, allocator<char> >(char const*, string const&);

+ 0 - 35
src/strstream.cpp

@@ -100,41 +100,6 @@ strstreambuf::strstreambuf(const unsigned char* __gnext, streamsize __n)
     __init((char*)__gnext, __n, nullptr);
     __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()
 strstreambuf::~strstreambuf()
 {
 {
     if (eback() && (__strmode_ & __allocated) != 0 && (__strmode_ & __frozen) == 0)
     if (eback() && (__strmode_ & __allocated) != 0 && (__strmode_ & __frozen) == 0)

+ 14 - 4
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 >  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));
+    }
 }
 }