================
@@ -157,6 +157,25 @@
 #define LLVM_DEPRECATED(MSG, FIX) [[deprecated(MSG)]]
 #endif
 
+// clang-format off
+#if defined(__clang__) || defined(__GNUC__)
+#define LLVM_IGNORE_DEPRECATIONS_OF_DECLARATIONS_BEGIN                         
\
----------------
jansvoboda11 wrote:

Maybe we could have a more generic macro?

```c++
#define DO_PRAGMA(x) _Pragma(#x)
#if defined(__clang__) || defined(__GNUC__)
#define LLVM_DISABLE_WARNING_BEGIN(GCC_FLAG, MSVC_NUMBER) \
  DO_PRAGMA(GCC diagnostic push)                          \
  DO_PRAGMA(GCC diagnostic ignored "-W" GCC_FLAG)
#define LLVM_DISABLE_WARNING_END                          \
  DO_PRAGMA(GCC diagnostic pop)
#elif defined(_MSC_VER)
#define LLVM_DISABLE_WARNING_BEGIN(GCC_FLAG, MSVC_NUMBER) \
  DO_PRAGMA(warning(push))                                \
  DO_PRAGMA(warning(disable: MSVC_NUMBER))
#define LLVM_DISABLE_WARNING_END                          \
  DO_PRAGMA(warning(pop))
#else
#define LLVM_DISABLE_WARNING_BEGIN(GCC_FLAG, MSVC_NUMBER)
#define LLVM_DISABLE_WARNING_END
#endif

LLVM_DISABLE_WARNING_BEGIN("deprecated-declarations", 4996)
EXPECT_EQ("dir/f2.cpp", F2->getFileEntry().getName());
LLVM_DISABLE_WARNING_END
```

https://github.com/llvm/llvm-project/pull/68157
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to