[clang-cl] Ignore /Wv and /Wv:17 flags
authorTobias Hieta <tobias@hieta.se>
Wed, 23 Mar 2022 09:21:36 +0000 (10:21 +0100)
committerTobias Hieta <tobias@hieta.se>
Thu, 24 Mar 2022 08:42:34 +0000 (09:42 +0100)
MSVC supports passing /Wv and /Wv:17 to ignore warnings added
since that version. Clang doesn't have a option like this - but
we can ignore this flag instead of error.

MSVC documentation: https://docs.microsoft.com/en-us/cpp/build/reference/compiler-option-warning-level

Reviewed By: hans, mstorsjo

Differential Revision: https://reviews.llvm.org/D122298

clang/include/clang/Driver/Options.td
clang/test/Driver/cl-options.c

index b5bd2d6..114b230 100644 (file)
@@ -6530,6 +6530,7 @@ def _SLASH_sdl_ : CLIgnoredFlag<"sdl-">;
 def _SLASH_utf8 : CLIgnoredFlag<"utf-8">,
   HelpText<"Set source and runtime encoding to UTF-8 (default)">;
 def _SLASH_w : CLIgnoredJoined<"w">;
+def _SLASH_Wv_ : CLIgnoredJoined<"Wv">;
 def _SLASH_Zc___cplusplus : CLIgnoredFlag<"Zc:__cplusplus">;
 def _SLASH_Zc_auto : CLIgnoredFlag<"Zc:auto">;
 def _SLASH_Zc_forScope : CLIgnoredFlag<"Zc:forScope">;
index f332cd8..244b443 100644 (file)
 // RUN:    /volatile:iso \
 // RUN:    /w12345 \
 // RUN:    /wd1234 \
+// RUN:    /Wv \
+// RUN:    /Wv:17 \
 // RUN:    /Zc:__cplusplus \
 // RUN:    /Zc:auto \
 // RUN:    /Zc:forScope \