From 871b49abfab90c37ff229b6559ef1c1a4c80b6d6 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Fri, 4 Apr 2014 01:36:55 +0000 Subject: [PATCH] Add clang-cl alias to allow users to disable c4005 If we ever want three or more aliases, at that point we should put MSVC warning ids in DiagnosticGroups.td. We can use that to support #pragma warning. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205598 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Driver/CLCompatOptions.td | 2 ++ test/Driver/cl-options.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/include/clang/Driver/CLCompatOptions.td b/include/clang/Driver/CLCompatOptions.td index d33e6b67f0..2bfc78ed1b 100644 --- a/include/clang/Driver/CLCompatOptions.td +++ b/include/clang/Driver/CLCompatOptions.td @@ -121,6 +121,8 @@ def _SLASH_WX : CLFlag<"WX">, HelpText<"Treat warnings as errors">, def _SLASH_WX_ : CLFlag<"WX-">, HelpText<"Do not treat warnings as errors">, Alias, AliasArgs<["no-error"]>; def _SLASH_w_flag : CLFlag<"w">, HelpText<"Disable all warnings">, Alias; +def _SLASH_wd4005 : CLFlag<"wd4005">, Alias, + AliasArgs<["no-macro-redefined"]>; def _SLASH_vd : CLJoined<"vd">, HelpText<"Control vtordisp placement">, Alias; def _SLASH_Z7 : CLFlag<"Z7">, Alias; diff --git a/test/Driver/cl-options.c b/test/Driver/cl-options.c index a666131173..84fa2699ee 100644 --- a/test/Driver/cl-options.c +++ b/test/Driver/cl-options.c @@ -129,6 +129,10 @@ // WJoined: "-cc1" // WJoined: "-Wunused-pragmas" +// For some warning ids, we can map from MSVC warning to Clang warning. +// RUN: %clang_cl -wd4005 -### -- %s 2>&1 | FileCheck -check-prefix=wd4005 %s +// wd4005: "-cc1" +// wd4005: "-Wno-macro-redefined" // Ignored options. Check that we don't get "unused during compilation" errors. // (/Zs is for syntax-only) -- 2.50.1