[libcxx] Fix detection of __is_final.

Summary: Currently we only enable the use of __is_final(...) with Clang. GCC also provides __is_final(...) since 4.7 in all standard modes. This patch creates the macro _LIBCPP_HAS_IS_FINAL to note the availability of `__is_final`.

Reviewers: danalbert, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D8795

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239664 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2015-06-13 07:08:02 +00:00
parent 6d7a2cb57d
commit 3a0e430cd4
8 changed files with 42 additions and 49 deletions

View File

@@ -1982,14 +1982,9 @@ public:
template <class _T1, class _T2, bool = is_same<typename remove_cv<_T1>::type,
typename remove_cv<_T2>::type>::value,
bool = is_empty<_T1>::value
#if __has_feature(is_final)
&& !__is_final(_T1)
#endif
,
&& !__libcpp_is_final<_T1>::value,
bool = is_empty<_T2>::value
#if __has_feature(is_final)
&& !__is_final(_T2)
#endif
&& !__libcpp_is_final<_T2>::value
>
struct __libcpp_compressed_pair_switch;