[cfe-commits] [libcxx] r146345 - in /libcxx/trunk/include: ext/hash_map map memory tuple unordered_map

Howard Hinnant hhinnant at apple.com
Sun Dec 11 12:31:33 PST 2011


Author: hhinnant
Date: Sun Dec 11 14:31:33 2011
New Revision: 146345

URL: http://llvm.org/viewvc/llvm-project?rev=146345&view=rev
Log:
Fix http://llvm.org/bugs/show_bug.cgi?id=11461.  Credit Alberto Ganesh Barbati.

Modified:
    libcxx/trunk/include/ext/hash_map
    libcxx/trunk/include/map
    libcxx/trunk/include/memory
    libcxx/trunk/include/tuple
    libcxx/trunk/include/unordered_map

Modified: libcxx/trunk/include/ext/hash_map
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/ext/hash_map?rev=146345&r1=146344&r2=146345&view=diff
==============================================================================
--- libcxx/trunk/include/ext/hash_map (original)
+++ libcxx/trunk/include/ext/hash_map Sun Dec 11 14:31:33 2011
@@ -215,7 +215,11 @@
 
 using namespace std;
 
-template <class _Tp, class _Hash, bool = is_empty<_Hash>::value>
+template <class _Tp, class _Hash, bool = is_empty<_Hash>::value
+#if __has_feature(is_final)
+                                         && !__is_final(_Hash)
+#endif
+        >
 class __hash_map_hasher
     : private _Hash
 {
@@ -247,7 +251,11 @@
         {return __hash_(__x);}
 };
 
-template <class _Tp, class _Pred, bool = is_empty<_Pred>::value>
+template <class _Tp, class _Pred, bool = is_empty<_Pred>::value
+#if __has_feature(is_final)
+                                         && !__is_final(_Pred)
+#endif
+         >
 class __hash_map_equal
     : private _Pred
 {

Modified: libcxx/trunk/include/map
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/map?rev=146345&r1=146344&r2=146345&view=diff
==============================================================================
--- libcxx/trunk/include/map (original)
+++ libcxx/trunk/include/map Sun Dec 11 14:31:33 2011
@@ -381,7 +381,11 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-template <class _Key, class _Tp, class _Compare, bool = is_empty<_Compare>::value>
+template <class _Key, class _Tp, class _Compare, bool = is_empty<_Compare>::value
+#if __has_feature(is_final)
+                                                        && !__is_final(_Compare)
+#endif
+         >
 class __map_value_compare
     : private _Compare
 {

Modified: libcxx/trunk/include/memory
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/memory?rev=146345&r1=146344&r2=146345&view=diff
==============================================================================
--- libcxx/trunk/include/memory (original)
+++ libcxx/trunk/include/memory Sun Dec 11 14:31:33 2011
@@ -1848,8 +1848,16 @@
 
 template <class _T1, class _T2, bool = is_same<typename remove_cv<_T1>::type,
                                                      typename remove_cv<_T2>::type>::value,
-                                bool = is_empty<_T1>::value,
-                                bool = is_empty<_T2>::value>
+                                bool = is_empty<_T1>::value
+#if __has_feature(is_final)
+                                       && !__is_final(_T1)
+#endif
+                                ,
+                                bool = is_empty<_T2>::value
+#if __has_feature(is_final)
+                                       && !__is_final(_T2)
+#endif
+         >
 struct __libcpp_compressed_pair_switch;
 
 template <class _T1, class _T2, bool IsSame>

Modified: libcxx/trunk/include/tuple
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/tuple?rev=146345&r1=146344&r2=146345&view=diff
==============================================================================
--- libcxx/trunk/include/tuple (original)
+++ libcxx/trunk/include/tuple Sun Dec 11 14:31:33 2011
@@ -146,7 +146,11 @@
 
 // __tuple_leaf
 
-template <size_t _Ip, class _Hp, bool=is_empty<_Hp>::value>
+template <size_t _Ip, class _Hp, bool=is_empty<_Hp>::value
+#if __has_feature(is_final)
+                                 && !__is_final(_Hp)
+#endif
+         >
 class __tuple_leaf;
 
 template <size_t _Ip, class _Hp, bool _Ep>

Modified: libcxx/trunk/include/unordered_map
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/unordered_map?rev=146345&r1=146344&r2=146345&view=diff
==============================================================================
--- libcxx/trunk/include/unordered_map (original)
+++ libcxx/trunk/include/unordered_map Sun Dec 11 14:31:33 2011
@@ -325,7 +325,11 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-template <class _Tp, class _Hash, bool = is_empty<_Hash>::value>
+template <class _Tp, class _Hash, bool = is_empty<_Hash>::value
+#if __has_feature(is_final)
+                                         && !__is_final(_Hash)
+#endif
+         >
 class __unordered_map_hasher
     : private _Hash
 {
@@ -371,7 +375,11 @@
         {return __hash_(__x);}
 };
 
-template <class _Tp, class _Pred, bool = is_empty<_Pred>::value>
+template <class _Tp, class _Pred, bool = is_empty<_Pred>::value
+#if __has_feature(is_final)
+                                         && !__is_final(_Pred)
+#endif
+         >
 class __unordered_map_equal
     : private _Pred
 {





More information about the cfe-commits mailing list