]> granicus.if.org Git - clang/commitdiff
Add clang-cl alias to allow users to disable c4005
authorReid Kleckner <reid@kleckner.net>
Fri, 4 Apr 2014 01:36:55 +0000 (01:36 +0000)
committerReid Kleckner <reid@kleckner.net>
Fri, 4 Apr 2014 01:36:55 +0000 (01:36 +0000)
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
test/Driver/cl-options.c

index d33e6b67f0d94380172542727c8a7b6cfecf6a13..2bfc78ed1b8e96af25c10a6e97c557750749fb00 100644 (file)
@@ -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<W_Joined>, AliasArgs<["no-error"]>;
 def _SLASH_w_flag : CLFlag<"w">, HelpText<"Disable all warnings">, Alias<w>;
+def _SLASH_wd4005 : CLFlag<"wd4005">, Alias<W_Joined>,
+  AliasArgs<["no-macro-redefined"]>;
 def _SLASH_vd : CLJoined<"vd">, HelpText<"Control vtordisp placement">,
   Alias<vtordisp_mode_EQ>;
 def _SLASH_Z7 : CLFlag<"Z7">, Alias<gline_tables_only>;
index a66613117370ae4dc92f1388ccf0b42c2bb87078..84fa2699eef9564c7b75e9112abbd513a3b31e6e 100644 (file)
 // 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)