Skip to content

Commit 85a5bab

Browse files
authored
type_traits: conditionally enable deprecated checks
1 parent 7dfb3ea commit 85a5bab

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

include/swift/Basic/type_traits.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@ template<typename T>
4444
struct IsTriviallyConstructible {
4545
#if defined(_LIBCPP_VERSION) || SWIFT_COMPILER_IS_MSVC
4646
// libc++ and MSVC implement is_trivially_constructible.
47-
static const bool value = std::is_trivially_constructible<T>::value;
48-
#elif __has_feature(__is_trivially_constructible) || __GNUC__ >= 5
47+
static const bool value = std::is_trivially_constructible<T>::value;
48+
#elif __has_feature(is_trivially_constructible)
4949
static const bool value = __is_trivially_constructible(T);
50+
#elif __has_feature(has_trivial_constructor) || __GNUC__ >= 5
51+
static const bool value = __has_trivial_constructor(T);
5052
#else
5153
# error "Not implemented"
5254
#endif
@@ -57,8 +59,10 @@ struct IsTriviallyDestructible {
5759
#if defined(_LIBCPP_VERSION) || SWIFT_COMPILER_IS_MSVC
5860
// libc++ and MSVC implement is_trivially_destructible.
5961
static const bool value = std::is_trivially_destructible<T>::value;
60-
#elif __has_feature(__is_trivially_destructible) || __GNUC__ >= 5
62+
#elif __has_feature(is_trivially_destructible)
6163
static const bool value = __is_trivially_destructible(T);
64+
#elif __has_feature(has_trivial_destructor) || __GNUC__ >= 5
65+
static const bool value = __has_trivial_destructor(T);
6266
#else
6367
# error "Not implemented"
6468
#endif

0 commit comments

Comments
 (0)