[llvm] b4c4de9 - Hide `#pragma clang` behind ifdef guards to fix MSVC "unknown pragma 'clang'" warning. NFC.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 16 01:54:45 PDT 2023


Author: Simon Pilgrim
Date: 2023-08-16T09:54:29+01:00
New Revision: b4c4de9cf828e1fc931c97a805d94db0fe995cae

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

LOG: Hide `#pragma clang` behind ifdef guards to fix MSVC "unknown pragma 'clang'" warning. NFC.

Added: 
    

Modified: 
    llvm/unittests/Option/OptionParsingTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/Option/OptionParsingTest.cpp b/llvm/unittests/Option/OptionParsingTest.cpp
index 254bf64c7f31be..465cddfc9e8e41 100644
--- a/llvm/unittests/Option/OptionParsingTest.cpp
+++ b/llvm/unittests/Option/OptionParsingTest.cpp
@@ -15,7 +15,9 @@
 using namespace llvm;
 using namespace llvm::opt;
 
+#if defined(__clang__)
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
 
 enum ID {
   OPT_INVALID = 0, // This is not an option ID.


        


More information about the llvm-commits mailing list