Skip to content

Commit e5ab9b4

Browse files
committed
include/swift/Basic: fix deprecation warnings
These are deprecation warnings ``` include/swift/Basic/type_traits.h:49:29: warning: builtin __has_trivial_constructor is deprecated; use __is_trivially_constructible instead [-Wdeprecated-builtins] static const bool value = __has_trivial_constructor(T); ^ include/swift/Basic/type_traits.h:61:29: warning: builtin __has_trivial_destructor is deprecated; use __is_trivially_destructible instead [-Wdeprecated-builtins] static const bool value = __has_trivial_destructor(T); ^ 2 warnings generated. ```
1 parent 25c9a6a commit e5ab9b4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/swift/Basic/type_traits.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ struct IsTriviallyConstructible {
4545
#if defined(_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(is_trivially_constructible)
49+
static const bool value = __is_trivially_constructible(T);
4850
#elif __has_feature(has_trivial_constructor) || __GNUC__ >= 5
4951
static const bool value = __has_trivial_constructor(T);
5052
#else
@@ -57,6 +59,8 @@ 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;
62+
#elif __has_feature(is_trivially_destructible)
63+
static const bool value = __is_trivially_destructible(T);
6064
#elif __has_feature(has_trivial_destructor) || __GNUC__ >= 5
6165
static const bool value = __has_trivial_destructor(T);
6266
#else

0 commit comments

Comments
 (0)