[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
llvm-svn: 239664
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: ee187e247bc2c7b97eb345e1de7f5ccf151e24e5
diff --git a/include/tuple b/include/tuple
index d838a95..3a22aa5 100644
--- a/include/tuple
+++ b/include/tuple
@@ -161,10 +161,8 @@
// __tuple_leaf
-template <size_t _Ip, class _Hp, bool=is_empty<_Hp>::value
-#if __has_feature(is_final)
- && !__is_final(_Hp)
-#endif
+template <size_t _Ip, class _Hp,
+ bool=is_empty<_Hp>::value && !__libcpp_is_final<_Hp>::value
>
class __tuple_leaf;