From 22ca1336dcfb663d86a6892dbe1e48eee20bb6db Mon Sep 17 00:00:00 2001 From: dim Date: Wed, 5 Mar 2014 19:30:36 +0000 Subject: MFC r261283: Import libc++ 3.4 release. This contains a lot of bugfixes, and some preliminary support for C++1y. MFC r261604: HEAD is not buildable for the past day. Commit a 'quick fix' in order to permit buildworld to complete. Reviewed by: theraven MFC r261608: Apply a cleaner solution for the sign warnings that can occur when compiling libc++'s header with -Wsystem-headers on. This has also been submitted upstream. Reported by: asomers MFC r261801: An ABI incompatibility crept into the libc++ 3.4 import in r261283. It was caused by upstream libc++ commit r194536, which aimed to make the headers more standards-compliant, by making std::pair's copy constructor trivial. Unfortunately, this could cause certain C++ applications using shared libraries built against the previous version of libc++ to crash. Fix the ABI incompatibility by making std::pair's copy constructor non-trivial again. Please note: Any C++ applications or shared libraries built with libc++ between r261283 and this revision should be recompiled. Reported by: stefanf --- contrib/libc++/include/ext/__hash | 6 +++--- contrib/libc++/include/ext/hash_map | 34 +++++++++++++++++++--------------- contrib/libc++/include/ext/hash_set | 10 +++++++--- 3 files changed, 29 insertions(+), 21 deletions(-) (limited to 'contrib/libc++/include/ext') diff --git a/contrib/libc++/include/ext/__hash b/contrib/libc++/include/ext/__hash index f6ecfe3..c0523cc 100644 --- a/contrib/libc++/include/ext/__hash +++ b/contrib/libc++/include/ext/__hash @@ -19,10 +19,10 @@ namespace __gnu_cxx { using namespace std; -template struct _LIBCPP_TYPE_VIS hash : public std::hash +template struct _LIBCPP_TYPE_VIS_ONLY hash : public std::hash<_Tp> { }; -template <> struct _LIBCPP_TYPE_VIS hash +template <> struct _LIBCPP_TYPE_VIS_ONLY hash : public unary_function { _LIBCPP_INLINE_VISIBILITY @@ -32,7 +32,7 @@ template <> struct _LIBCPP_TYPE_VIS hash } }; -template <> struct _LIBCPP_TYPE_VIS hash +template <> struct _LIBCPP_TYPE_VIS_ONLY hash : public unary_function { _LIBCPP_INLINE_VISIBILITY diff --git a/contrib/libc++/include/ext/hash_map b/contrib/libc++/include/ext/hash_map index a6fe894..225b72b 100644 --- a/contrib/libc++/include/ext/hash_map +++ b/contrib/libc++/include/ext/hash_map @@ -206,7 +206,11 @@ template #include #if __DEPRECATED -#warning Use of the header is deprecated. Migrate to +#if defined(_MSC_VER) && ! defined(__clang__) + _LIBCPP_WARNING("Use of the header is deprecated. Migrate to ") +#else +# warning Use of the header is deprecated. Migrate to +#endif #endif #pragma GCC system_header @@ -361,7 +365,7 @@ public: }; template -class _LIBCPP_TYPE_VIS __hash_map_iterator +class _LIBCPP_TYPE_VIS_ONLY __hash_map_iterator { _HashIterator __i_; @@ -404,15 +408,15 @@ public: bool operator!=(const __hash_map_iterator& __x, const __hash_map_iterator& __y) {return __x.__i_ != __y.__i_;} - template friend class _LIBCPP_TYPE_VIS hash_map; - template friend class _LIBCPP_TYPE_VIS hash_multimap; - template friend class _LIBCPP_TYPE_VIS __hash_const_iterator; - template friend class _LIBCPP_TYPE_VIS __hash_const_local_iterator; - template friend class _LIBCPP_TYPE_VIS __hash_map_const_iterator; + template friend class _LIBCPP_TYPE_VIS_ONLY hash_map; + template friend class _LIBCPP_TYPE_VIS_ONLY hash_multimap; + template friend class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator; + template friend class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator; + template friend class _LIBCPP_TYPE_VIS_ONLY __hash_map_const_iterator; }; template -class _LIBCPP_TYPE_VIS __hash_map_const_iterator +class _LIBCPP_TYPE_VIS_ONLY __hash_map_const_iterator { _HashIterator __i_; @@ -463,15 +467,15 @@ public: bool operator!=(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y) {return __x.__i_ != __y.__i_;} - template friend class _LIBCPP_TYPE_VIS hash_map; - template friend class _LIBCPP_TYPE_VIS hash_multimap; - template friend class _LIBCPP_TYPE_VIS __hash_const_iterator; - template friend class _LIBCPP_TYPE_VIS __hash_const_local_iterator; + template friend class _LIBCPP_TYPE_VIS_ONLY hash_map; + template friend class _LIBCPP_TYPE_VIS_ONLY hash_multimap; + template friend class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator; + template friend class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator; }; template , class _Pred = equal_to<_Key>, class _Alloc = allocator > > -class _LIBCPP_TYPE_VIS hash_map +class _LIBCPP_TYPE_VIS_ONLY hash_map { public: // types @@ -684,7 +688,7 @@ hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(const key_type& __k) __h.get_deleter().__first_constructed = true; __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second)); __h.get_deleter().__second_constructed = true; - return _VSTD::move(__h); + return _VSTD::move(__h); // explicitly moved for C++03 } template @@ -750,7 +754,7 @@ operator!=(const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, template , class _Pred = equal_to<_Key>, class _Alloc = allocator > > -class _LIBCPP_TYPE_VIS hash_multimap +class _LIBCPP_TYPE_VIS_ONLY hash_multimap { public: // types diff --git a/contrib/libc++/include/ext/hash_set b/contrib/libc++/include/ext/hash_set index 52bbeee..c4bb898 100644 --- a/contrib/libc++/include/ext/hash_set +++ b/contrib/libc++/include/ext/hash_set @@ -199,7 +199,11 @@ template #include #if __DEPRECATED -#warning Use of the header is deprecated. Migrate to +#if defined(_MSC_VER) && ! defined(__clang__) + _LIBCPP_WARNING("Use of the header is deprecated. Migrate to ") +#else +# warning Use of the header is deprecated. Migrate to +#endif #endif namespace __gnu_cxx { @@ -208,7 +212,7 @@ using namespace std; template , class _Pred = equal_to<_Value>, class _Alloc = allocator<_Value> > -class _LIBCPP_TYPE_VIS hash_set +class _LIBCPP_TYPE_VIS_ONLY hash_set { public: // types @@ -429,7 +433,7 @@ operator!=(const hash_set<_Value, _Hash, _Pred, _Alloc>& __x, template , class _Pred = equal_to<_Value>, class _Alloc = allocator<_Value> > -class _LIBCPP_TYPE_VIS hash_multiset +class _LIBCPP_TYPE_VIS_ONLY hash_multiset { public: // types -- cgit v1.1