Skip to content

Commit

Permalink
[clang-cl] Ignore /Wv and /Wv:17 flags
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tru committed Mar 24, 2022
1 parent ca46521 commit 67d9276
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -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">;
Expand Down
2 changes: 2 additions & 0 deletions clang/test/Driver/cl-options.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,8 @@
// RUN: /volatile:iso \
// RUN: /w12345 \
// RUN: /wd1234 \
// RUN: /Wv \
// RUN: /Wv:17 \
// RUN: /Zc:__cplusplus \
// RUN: /Zc:auto \
// RUN: /Zc:forScope \
Expand Down

0 comments on commit 67d9276

Please sign in to comment.