From 67d9276b16024bae66dfc2fcb739d947637b8c52 Mon Sep 17 00:00:00 2001 From: Tobias Hieta Date: Wed, 23 Mar 2022 10:21:36 +0100 Subject: [PATCH] [clang-cl] Ignore /Wv and /Wv:17 flags 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 | 1 + clang/test/Driver/cl-options.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index b5bd2d6..114b230 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -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">; diff --git a/clang/test/Driver/cl-options.c b/clang/test/Driver/cl-options.c index f332cd83..244b443 100644 --- a/clang/test/Driver/cl-options.c +++ b/clang/test/Driver/cl-options.c @@ -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 \ -- 2.7.4