]> granicus.if.org Git - clang/commitdiff
[clang-cl] Let /W4 map to -Wall -Wextra instead of just -Wall.
authorNico Weber <nicolasweber@gmx.de>
Fri, 11 Dec 2015 22:31:16 +0000 (22:31 +0000)
committerNico Weber <nicolasweber@gmx.de>
Fri, 11 Dec 2015 22:31:16 +0000 (22:31 +0000)
There's no way to make a flag alias to two flags, so add a /WCL4 flag that
maps to the All, Extra diag groups.  Fixes PR25563.

http://reviews.llvm.org/D15350

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255382 91177308-0d34-0410-b5e6-96231b3b80d8

docs/UsersManual.rst
include/clang/Basic/DiagnosticGroups.td
include/clang/Driver/CLCompatOptions.td
include/clang/Driver/Options.td
test/Driver/cl-options.c

index 3226014b41f38389700eef466a9bee6609178261..aa891c763044fd1e6774580da3ccaf3151355230 100644 (file)
@@ -2080,7 +2080,7 @@ Execute ``clang-cl /?`` to see a list of supported options:
       /W1                    Enable -Wall
       /W2                    Enable -Wall
       /W3                    Enable -Wall
-      /W4                    Enable -Wall
+      /W4                    Enable -Wall and -Wextra
       /Wall                  Enable -Wall
       /WX-                   Do not treat warnings as errors
       /WX                    Treat warnings as errors
index 64add07b1737d3068c6505db1b8470d86d1bc5f6..44a6a114ed74c1fde992b3e0cb4b795fb715d24c 100644 (file)
@@ -663,7 +663,10 @@ def Consumed       : DiagGroup<"consumed">;
 // Note that putting warnings in -Wall will not disable them by default. If a
 // warning should be active _only_ when -Wall is passed in, mark it as
 // DefaultIgnore in addition to putting it here.
-def : DiagGroup<"all", [Most, Parentheses, Switch, SwitchBool]>;
+def All : DiagGroup<"all", [Most, Parentheses, Switch, SwitchBool]>;
+
+// Warnings that should be in clang-cl /w4.
+def : DiagGroup<"CL4", [All, Extra]>;
 
 // Warnings enabled by -pedantic.  This is magically filled in by TableGen.
 def Pedantic : DiagGroup<"pedantic">;
index a8282b46e0586711929fc381b1a7b16a816d48c4..8da6e8c08c8db8127c84d9951697bc45dadce70e 100644 (file)
@@ -119,7 +119,7 @@ def _SLASH_W0 : CLFlag<"W0">, HelpText<"Disable all warnings">, Alias<w>;
 def _SLASH_W1 : CLFlag<"W1">, HelpText<"Enable -Wall">, Alias<Wall>;
 def _SLASH_W2 : CLFlag<"W2">, HelpText<"Enable -Wall">, Alias<Wall>;
 def _SLASH_W3 : CLFlag<"W3">, HelpText<"Enable -Wall">, Alias<Wall>;
-def _SLASH_W4 : CLFlag<"W4">, HelpText<"Enable -Wall">, Alias<Wall>;
+def _SLASH_W4 : CLFlag<"W4">, HelpText<"Enable -Wall and -Wextra">, Alias<WCL4>;
 def _SLASH_Wall : CLFlag<"Wall">, HelpText<"Enable -Wall">, Alias<Wall>;
 def _SLASH_WX : CLFlag<"WX">, HelpText<"Treat warnings as errors">,
   Alias<W_Joined>, AliasArgs<["error"]>;
index 9852ecf2a5231054ffa77e60ef0907e2f55e039d..8c2791607a19fcf9a7e0743b6163964e839e2984 100644 (file)
@@ -295,6 +295,7 @@ def Wa_COMMA : CommaJoined<["-"], "Wa,">,
   HelpText<"Pass the comma separated arguments in <arg> to the assembler">,
   MetaVarName<"<arg>">;
 def Wall : Flag<["-"], "Wall">, Group<W_Group>, Flags<[CC1Option]>;
+def WCL4 : Flag<["-"], "WCL4">, Group<W_Group>, Flags<[CC1Option]>;
 def Wdeprecated : Flag<["-"], "Wdeprecated">, Group<W_Group>, Flags<[CC1Option]>;
 def Wno_deprecated : Flag<["-"], "Wno-deprecated">, Group<W_Group>, Flags<[CC1Option]>;
 def Wextra : Flag<["-"], "Wextra">, Group<W_Group>, Flags<[CC1Option]>;
index 180b15ead391d229fb53580f0fc16a5d8413c31d..fc56be8993422ec7914ed91961c367f57d4b427c 100644 (file)
 // RUN: %clang_cl /W1 -### -- %s 2>&1 | FileCheck -check-prefix=W1 %s
 // RUN: %clang_cl /W2 -### -- %s 2>&1 | FileCheck -check-prefix=W1 %s
 // RUN: %clang_cl /W3 -### -- %s 2>&1 | FileCheck -check-prefix=W1 %s
-// RUN: %clang_cl /W4 -### -- %s 2>&1 | FileCheck -check-prefix=W1 %s
+// RUN: %clang_cl /W4 -### -- %s 2>&1 | FileCheck -check-prefix=W4 %s
 // RUN: %clang_cl /Wall -### -- %s 2>&1 | FileCheck -check-prefix=W1 %s
 // W1: -Wall
+// W4: -WCL4
 
 // RUN: %clang_cl /WX -### -- %s 2>&1 | FileCheck -check-prefix=WX %s
 // WX: -Werror