Skip to content

Commit 0953fb4

Browse files
committed
[Driver] Ensure -W<warning> gets HelpHidden
Individual groups should not be displayed in --help. Fix two violations and change the test to prevent regression.
1 parent 43d0bb5 commit 0953fb4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -978,15 +978,15 @@ def Wsystem_headers_in_module_EQ : Joined<["-"], "Wsystem-headers-in-module=">,
978978
HelpText<"Enable -Wsystem-headers when building <module>">,
979979
MarshallingInfoStringVector<DiagnosticOpts<"SystemHeaderWarningsModules">>;
980980
def Wdeprecated : Flag<["-"], "Wdeprecated">, Group<W_Group>,
981-
Visibility<[ClangOption, CC1Option]>,
981+
Flags<[HelpHidden]>, Visibility<[ClangOption, CC1Option]>,
982982
HelpText<"Enable warnings for deprecated constructs and define __DEPRECATED">;
983983
def Wno_deprecated : Flag<["-"], "Wno-deprecated">, Group<W_Group>,
984984
Visibility<[ClangOption, CC1Option]>;
985985
defm invalid_constexpr : BoolWOption<"invalid-constexpr",
986986
LangOpts<"CheckConstexprFunctionBodies">,
987987
Default<!strconcat("!", cpp23.KeyPath)>,
988-
NegFlag<SetFalse, [], [ClangOption, CC1Option], "Disable">,
989-
PosFlag<SetTrue, [], [ClangOption, CC1Option], "Enable">,
988+
NegFlag<SetFalse, [HelpHidden], [ClangOption, CC1Option], "Disable">,
989+
PosFlag<SetTrue, [HelpHidden], [ClangOption, CC1Option], "Enable">,
990990
BothFlags<[], [ClangOption, CC1Option], " checking of constexpr function bodies for validity within a constant expression context">>;
991991
def Wl_COMMA : CommaJoined<["-"], "Wl,">, Visibility<[ClangOption, FlangOption]>,
992992
Flags<[LinkerInput, RenderAsInput]>,

clang/test/Driver/immediate-options.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// HELP: isystem
33
// HELP-NOT: ast-dump
44
// HELP-NOT: driver-mode
5+
// HELP: -Wa,
6+
// HELP-NOT: -W{{[a-z][a-z]}}
57

68
// Make sure that Flang-only options are not available in Clang
79
// HELP-NOT: test-io

0 commit comments

Comments
 (0)