[libcxx-commits] [libcxx] 3609110 - Implement _LIBCPP_SUPPRESS_DEPRECATED_XXX when testing MSVC's STL

Casey Carter via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 16 09:50:58 PDT 2020


Author: Casey Carter
Date: 2020-03-16T09:50:23-07:00
New Revision: 360911096755f333c59d03c098e3c7a656c8f1d2

URL: https://github.com/llvm/llvm-project/commit/360911096755f333c59d03c098e3c7a656c8f1d2
DIFF: https://github.com/llvm/llvm-project/commit/360911096755f333c59d03c098e3c7a656c8f1d2.diff

LOG: Implement _LIBCPP_SUPPRESS_DEPRECATED_XXX when testing MSVC's STL

...to properly silence clang deprecation warnings in `test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp`.

Added: 
    

Modified: 
    libcxx/test/support/msvc_stdlib_force_include.h

Removed: 
    


################################################################################
diff  --git a/libcxx/test/support/msvc_stdlib_force_include.h b/libcxx/test/support/msvc_stdlib_force_include.h
index fd47af4e7983..768558efe76f 100644
--- a/libcxx/test/support/msvc_stdlib_force_include.h
+++ b/libcxx/test/support/msvc_stdlib_force_include.h
@@ -91,7 +91,19 @@ const AssertionDialogAvoider assertion_dialog_avoider{};
 #endif
 
 #define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
-#define _LIBCPP_SUPPRESS_DEPRECATED_PUSH
-#define _LIBCPP_SUPPRESS_DEPRECATED_POP
+
+#ifdef __clang__
+#define _LIBCPP_SUPPRESS_DEPRECATED_PUSH \
+    _Pragma("GCC diagnostic push") \
+    _Pragma("GCC diagnostic ignored \"-Wdeprecated\"")
+#define _LIBCPP_SUPPRESS_DEPRECATED_POP \
+    _Pragma("GCC diagnostic pop")
+#else // ^^^ clang / MSVC vvv
+#define _LIBCPP_SUPPRESS_DEPRECATED_PUSH \
+    __pragma(warning(push)) \
+    __pragma(warning(disable : 4996))
+#define _LIBCPP_SUPPRESS_DEPRECATED_POP \
+    __pragma(warning(pop))
+#endif // __clang__
 
 #endif // SUPPORT_MSVC_STDLIB_FORCE_INCLUDE_H


        


More information about the libcxx-commits mailing list