Skip to content

Commit a19fd21

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 a19fd21

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/swift/Basic/type_traits.h

Lines changed: 5 additions & 1 deletion
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,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;
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
61-
static const bool value = __has_trivial_destructor(T);
65+
static const bool value = __has_trivial_destructor(T);
6266
#else
6367
# error "Not implemented"
6468
#endif

0 commit comments

Comments
 (0)