Skip to content

Commit

Permalink
[clang] Add option to opt out of the missing_dependent_template_keywo…
Browse files Browse the repository at this point in the history
…rd diagnostic (#98613)

After commit ce4aada, we observed many
warnings in our internal codebase. It is infeasible to fix all at once.

Currently, there is no way to disable this warning. This patch provides
a way to disable it using the `-Wno-missing-dependent-template-keyword` flag.
  • Loading branch information
hokein authored Jul 12, 2024
1 parent 84bc0a9 commit 8ef26f1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ Resolutions to C++ Defect Reports

- Clang now correctly implements lookup for the terminal name of a member-qualified nested-name-specifier.
(`CWG1835: Dependent member lookup before < <https://cplusplus.github.io/CWG/issues/1835.html>`_).
The warning can be disabled via `-Wno-missing-dependent-template-keyword`.

C Language Changes
------------------
Expand Down
3 changes: 2 additions & 1 deletion clang/include/clang/Basic/DiagnosticParseKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,8 @@ def missing_template_arg_list_after_template_kw : Extension<
DefaultError;

def ext_missing_dependent_template_keyword : ExtWarn<
"use 'template' keyword to treat '%0' as a dependent template name">;
"use 'template' keyword to treat '%0' as a dependent template name">,
InGroup<DiagGroup<"missing-dependent-template-keyword">>;

def ext_extern_template : Extension<
"extern templates are a C++11 extension">, InGroup<CXX11>;
Expand Down
3 changes: 1 addition & 2 deletions clang/test/Misc/warning-flags.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ This test serves two purposes:

The list of warnings below should NEVER grow. It should gradually shrink to 0.

CHECK: Warnings without flags (65):
CHECK: Warnings without flags (64):

CHECK-NEXT: ext_expected_semi_decl_list
CHECK-NEXT: ext_missing_dependent_template_keyword
CHECK-NEXT: ext_missing_whitespace_after_macro_name
CHECK-NEXT: ext_new_paren_array_nonconst
CHECK-NEXT: ext_plain_complex
Expand Down

0 comments on commit 8ef26f1

Please sign in to comment.