Skip to content

Commit 4eacb4d

Browse files
committed
NFC: Suppress -Wdeprecated-declarations warnings in Mutex.h.
The `is_literal` trait is deprecated in C++17.
1 parent 3a3a246 commit 4eacb4d

File tree

1 file changed

+9
-0
lines changed
  • stdlib/toolchain/Compatibility56/include/Concurrency/Threading

1 file changed

+9
-0
lines changed

stdlib/toolchain/Compatibility56/include/Concurrency/Threading/Mutex.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,26 +982,35 @@ using SmallMutex =
982982

983983
// Enforce literal requirements for static variants.
984984
#if SWIFT_MUTEX_SUPPORTS_CONSTEXPR
985+
#pragma clang diagnostic push
986+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
985987
static_assert(std::is_literal_type<StaticMutex>::value,
986988
"StaticMutex must be literal type");
987989
static_assert(std::is_literal_type<StaticUnsafeMutex>::value,
988990
"StaticUnsafeMutex must be literal type");
991+
#pragma clang diagnostic pop
989992
#else
990993
// Your platform doesn't currently support statically allocated Mutex
991994
// you will possibly see global-constructors warnings
992995
#endif
993996

994997
#if SWIFT_CONDITION_SUPPORTS_CONSTEXPR
998+
#pragma clang diagnostic push
999+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
9951000
static_assert(std::is_literal_type<StaticConditionVariable>::value,
9961001
"StaticConditionVariable must be literal type");
1002+
#pragma clang diagnostic pop
9971003
#else
9981004
// Your platform doesn't currently support statically allocated ConditionVar
9991005
// you will possibly see global-constructors warnings
10001006
#endif
10011007

10021008
#if SWIFT_READWRITELOCK_SUPPORTS_CONSTEXPR
1009+
#pragma clang diagnostic push
1010+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
10031011
static_assert(std::is_literal_type<StaticReadWriteLock>::value,
10041012
"StaticReadWriteLock must be literal type");
1013+
#pragma clang diagnostic pop
10051014
#else
10061015
// Your platform doesn't currently support statically allocated ReadWriteLocks
10071016
// you will possibly see global-constructors warnings

0 commit comments

Comments
 (0)