Skip to content

Commit 8ef26f1

Browse files
authored
[clang] Add option to opt out of the missing_dependent_template_keyword 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.
1 parent 84bc0a9 commit 8ef26f1

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ Resolutions to C++ Defect Reports
315315

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

319320
C Language Changes
320321
------------------

clang/include/clang/Basic/DiagnosticParseKinds.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,8 @@ def missing_template_arg_list_after_template_kw : Extension<
896896
DefaultError;
897897

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

901902
def ext_extern_template : Extension<
902903
"extern templates are a C++11 extension">, InGroup<CXX11>;

clang/test/Misc/warning-flags.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ This test serves two purposes:
1818

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

21-
CHECK: Warnings without flags (65):
21+
CHECK: Warnings without flags (64):
2222

2323
CHECK-NEXT: ext_expected_semi_decl_list
24-
CHECK-NEXT: ext_missing_dependent_template_keyword
2524
CHECK-NEXT: ext_missing_whitespace_after_macro_name
2625
CHECK-NEXT: ext_new_paren_array_nonconst
2726
CHECK-NEXT: ext_plain_complex

0 commit comments

Comments
 (0)