This patch gets std::is_void to dispatch to new built-in trait __is_void.

libstdc++-v3/ChangeLog:

        * include/std/type_traits (is_void): Use __is_void built-in trait.

Signed-off-by: Ken Matsui <kmat...@cs.washington.edu>
---
 libstdc++-v3/include/std/type_traits | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libstdc++-v3/include/std/type_traits 
b/libstdc++-v3/include/std/type_traits
index 9eafd6b16f2..98764685a39 100644
--- a/libstdc++-v3/include/std/type_traits
+++ b/libstdc++-v3/include/std/type_traits
@@ -294,6 +294,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   // Primary type categories.
 
   /// is_void
+#if __has_builtin(__is_void)
+  template<typename _Tp>
+    struct is_void
+    : public __bool_constant<__is_void(_Tp)>
+    { };
+#else
   template<typename _Tp>
     struct is_void
     : public false_type { };
@@ -313,6 +319,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   template<>
     struct is_void<const volatile void>
     : public true_type { };
+#endif
 
   /// @cond undocumented
   template<typename>
-- 
2.40.0

Reply via email to