Skip to content

Commit 04fce15

Browse files
committed
[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.
1 parent aff896d commit 04fce15

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

libcxx/include/type_traits

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2883,7 +2883,11 @@ namespace __is_construct
28832883
struct __nat {};
28842884
}
28852885

2886-
#if !defined(_LIBCPP_CXX03_LANG) && !__has_feature(is_constructible) && !defined(_LIBCPP_COMPILER_GCC)
2886+
#if defined(_LIBCPP_COMPILER_GCC) && _GNUC_VER_NEW >= 10000
2887+
# define _LIBCPP_GCC_SUPPORTS_IS_CONSTRUCTIBLE
2888+
#endif
2889+
2890+
#if !defined(_LIBCPP_CXX03_LANG) && !__has_feature(is_constructible) && !defined(_LIBCPP_GCC_SUPPORTS_IS_CONSTRUCTIBLE)
28872891

28882892
template <class _Tp, class... _Args>
28892893
struct __libcpp_is_constructible;
@@ -2998,7 +3002,7 @@ struct __libcpp_is_constructible<_Tp&&, _A0>
29983002

29993003
#endif
30003004

3001-
#if __has_feature(is_constructible) || defined(_LIBCPP_COMPILER_GCC)
3005+
#if __has_feature(is_constructible) || defined(_LIBCPP_GCC_SUPPORTS_IS_CONSTRUCTIBLE)
30023006
template <class _Tp, class ..._Args>
30033007
struct _LIBCPP_TEMPLATE_VIS is_constructible
30043008
: public integral_constant<bool, __is_constructible(_Tp, _Args...)>

libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
// template <class T, class... Args>
1212
// struct is_constructible;
1313

14+
// UNSUPPORTED: gcc-5, gcc-6, gcc-7, gcc-8, gcc-9
15+
1416
#include <type_traits>
1517
#include "test_macros.h"
1618

0 commit comments

Comments
 (0)