Skip to content

Commit e22347f

Browse files
authored
Merge pull request swiftlang#19966 from compnerd/gcc
type_traits: fix build with GCC
2 parents 7a7657b + 0e7f4d0 commit e22347f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/swift/Basic/type_traits.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct IsTriviallyCopyable {
3333
#if _LIBCPP_VERSION || SWIFT_COMPILER_IS_MSVC
3434
// libc++ and MSVC implement is_trivially_copyable.
3535
static const bool value = std::is_trivially_copyable<T>::value;
36-
#elif __has_feature(is_trivially_copyable)
36+
#elif __has_feature(is_trivially_copyable) || __GNUC__ >= 5
3737
static const bool value = __is_trivially_copyable(T);
3838
#else
3939
# error "Not implemented"
@@ -45,7 +45,7 @@ struct IsTriviallyConstructible {
4545
#if _LIBCPP_VERSION || SWIFT_COMPILER_IS_MSVC
4646
// libc++ and MSVC implement is_trivially_constructible.
4747
static const bool value = std::is_trivially_constructible<T>::value;
48-
#elif __has_feature(has_trivial_constructor)
48+
#elif __has_feature(has_trivial_constructor) || __GNUC__ >= 5
4949
static const bool value = __has_trivial_constructor(T);
5050
#else
5151
# error "Not implemented"
@@ -57,7 +57,7 @@ struct IsTriviallyDestructible {
5757
#if _LIBCPP_VERSION || SWIFT_COMPILER_IS_MSVC
5858
// libc++ and MSVC implement is_trivially_destructible.
5959
static const bool value = std::is_trivially_destructible<T>::value;
60-
#elif __has_feature(has_trivial_destructor)
60+
#elif __has_feature(has_trivial_destructor) || __GNUC__ >= 5
6161
static const bool value = __has_trivial_destructor(T);
6262
#else
6363
# error "Not implemented"

0 commit comments

Comments
 (0)