[libc++] Implement _LIBCPP_SUPPRESS_DEPRECATED macros in terms of _LIBCPP_DIAGNOSTIC macros#143857
Merged
Merged
Conversation
…BCPP_DIAGNOSTIC macros
450c22e to
9cb19ae
Compare
Member
|
@llvm/pr-subscribers-libcxx Author: Nikolas Klauser (philnik777) ChangesThis makes the code a bit more consistent, since we use the Full diff: https://github.com/llvm/llvm-project/pull/143857.diff 1 Files Affected:
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 58ca9bab937e4..f2199764713b8 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -416,6 +416,12 @@ typedef __char32_t char32_t;
# define _LIBCPP_GCC_DIAGNOSTIC_IGNORED(str)
# endif
+// Macros to enter and leave a state where deprecation warnings are suppressed.
+# define _LIBCPP_SUPPRESS_DEPRECATED_PUSH \
+ _LIBCPP_DIAGNOSTIC_PUSH _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated") \
+ _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
+# define _LIBCPP_SUPPRESS_DEPRECATED_POP _LIBCPP_DIAGNOSTIC_POP
+
# if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_FAST
# define _LIBCPP_HARDENING_SIG f
# elif _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_EXTENSIVE
@@ -717,17 +723,6 @@ typedef __char32_t char32_t;
# define _LIBCPP_DEPRECATED_WITH_CHAR8_T
# endif
-// Macros to enter and leave a state where deprecation warnings are suppressed.
-# if defined(_LIBCPP_COMPILER_CLANG_BASED) || defined(_LIBCPP_COMPILER_GCC)
-# define _LIBCPP_SUPPRESS_DEPRECATED_PUSH \
- _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wdeprecated\"") \
- _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
-# define _LIBCPP_SUPPRESS_DEPRECATED_POP _Pragma("GCC diagnostic pop")
-# else
-# define _LIBCPP_SUPPRESS_DEPRECATED_PUSH
-# define _LIBCPP_SUPPRESS_DEPRECATED_POP
-# endif
-
# if _LIBCPP_STD_VER <= 11
# define _LIBCPP_EXPLICIT_SINCE_CXX14
# else
|
This was referenced Jul 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes the code a bit more consistent, since we use the
_LIBCPP_DIAGNOSTICmacros everywhere else.