From 04fce1515b7ae2fcf7986d8578c18cfd559c68b2 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Fri, 2 Oct 2020 17:30:42 -0400 Subject: [PATCH] [libc++] Fix the build with GCC < 10 For now, we still need to support older GCCs, so work around the lack of __is_constructible on older GCCs. --- libcxx/include/type_traits | 8 ++++++-- .../meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits index 0355638..75d60cd 100644 --- a/libcxx/include/type_traits +++ b/libcxx/include/type_traits @@ -2883,7 +2883,11 @@ namespace __is_construct struct __nat {}; } -#if !defined(_LIBCPP_CXX03_LANG) && !__has_feature(is_constructible) && !defined(_LIBCPP_COMPILER_GCC) +#if defined(_LIBCPP_COMPILER_GCC) && _GNUC_VER_NEW >= 10000 +# define _LIBCPP_GCC_SUPPORTS_IS_CONSTRUCTIBLE +#endif + +#if !defined(_LIBCPP_CXX03_LANG) && !__has_feature(is_constructible) && !defined(_LIBCPP_GCC_SUPPORTS_IS_CONSTRUCTIBLE) template struct __libcpp_is_constructible; @@ -2998,7 +3002,7 @@ struct __libcpp_is_constructible<_Tp&&, _A0> #endif -#if __has_feature(is_constructible) || defined(_LIBCPP_COMPILER_GCC) +#if __has_feature(is_constructible) || defined(_LIBCPP_GCC_SUPPORTS_IS_CONSTRUCTIBLE) template struct _LIBCPP_TEMPLATE_VIS is_constructible : public integral_constant diff --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp index e4fad7c..d8ee865 100644 --- a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp +++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp @@ -11,6 +11,8 @@ // template // struct is_constructible; +// UNSUPPORTED: gcc-5, gcc-6, gcc-7, gcc-8, gcc-9 + #include #include "test_macros.h" -- 2.7.4