From d4cf215e0852a748a6881ba36f2b81eda7d40e85 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Sun, 11 Dec 2011 20:31:33 +0000 Subject: [PATCH] Fix http://llvm.org/bugs/show_bug.cgi?id=11461. Credit Alberto Ganesh Barbati. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@146345 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/ext/hash_map | 12 ++++++++++-- include/map | 6 +++++- include/memory | 12 ++++++++++-- include/tuple | 6 +++++- include/unordered_map | 12 ++++++++++-- 5 files changed, 40 insertions(+), 8 deletions(-) diff --git a/include/ext/hash_map b/include/ext/hash_map index f6a11f07f..bebdccb3c 100644 --- a/include/ext/hash_map +++ b/include/ext/hash_map @@ -215,7 +215,11 @@ namespace __gnu_cxx { using namespace std; -template ::value> +template ::value +#if __has_feature(is_final) + && !__is_final(_Hash) +#endif + > class __hash_map_hasher : private _Hash { @@ -247,7 +251,11 @@ public: {return __hash_(__x);} }; -template ::value> +template ::value +#if __has_feature(is_final) + && !__is_final(_Pred) +#endif + > class __hash_map_equal : private _Pred { diff --git a/include/map b/include/map index abdaa3b6b..633579b7e 100644 --- a/include/map +++ b/include/map @@ -381,7 +381,11 @@ swap(multimap& x, _LIBCPP_BEGIN_NAMESPACE_STD -template ::value> +template ::value +#if __has_feature(is_final) + && !__is_final(_Compare) +#endif + > class __map_value_compare : private _Compare { diff --git a/include/memory b/include/memory index c3e3af4a5..e7fe78eda 100644 --- a/include/memory +++ b/include/memory @@ -1848,8 +1848,16 @@ public: template ::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 diff --git a/include/tuple b/include/tuple index d0f832e3b..9ae0587a5 100644 --- a/include/tuple +++ b/include/tuple @@ -146,7 +146,11 @@ public: // __tuple_leaf -template ::value> +template ::value +#if __has_feature(is_final) + && !__is_final(_Hp) +#endif + > class __tuple_leaf; template diff --git a/include/unordered_map b/include/unordered_map index 0862e3fe0..3b1701e2f 100644 --- a/include/unordered_map +++ b/include/unordered_map @@ -325,7 +325,11 @@ template _LIBCPP_BEGIN_NAMESPACE_STD -template ::value> +template ::value +#if __has_feature(is_final) + && !__is_final(_Hash) +#endif + > class __unordered_map_hasher : private _Hash { @@ -371,7 +375,11 @@ public: {return __hash_(__x);} }; -template ::value> +template ::value +#if __has_feature(is_final) + && !__is_final(_Pred) +#endif + > class __unordered_map_equal : private _Pred {