This revision was automatically updated to reflect the committed changes. Closed by commit rG41a6612ea8af: Put microsoft template parameter shadow warning behind separate flag (PR44794) (authored by hans). Herald added a project: clang.
Changed prior to commit: https://reviews.llvm.org/D75121?vs=246471&id=246713#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75121/new/ https://reviews.llvm.org/D75121 Files: clang/include/clang/Basic/DiagnosticGroups.td clang/include/clang/Basic/DiagnosticSemaKinds.td clang/test/SemaCXX/microsoft-template-shadow.cpp Index: clang/test/SemaCXX/microsoft-template-shadow.cpp =================================================================== --- /dev/null +++ clang/test/SemaCXX/microsoft-template-shadow.cpp @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -verify -fms-compatibility -Wno-microsoft -Wmicrosoft-template-shadow + +template <typename T> // expected-note {{template parameter is declared here}} +struct Outmost { + template <typename T> // expected-warning {{declaration of 'T' shadows template parameter}} + struct Inner { + void f() { + T *var; + } + }; +}; Index: clang/include/clang/Basic/DiagnosticSemaKinds.td =================================================================== --- clang/include/clang/Basic/DiagnosticSemaKinds.td +++ clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -4273,7 +4273,7 @@ def err_template_param_shadow : Error< "declaration of %0 shadows template parameter">; def ext_template_param_shadow : ExtWarn< - err_template_param_shadow.Text>, InGroup<MicrosoftTemplate>; + err_template_param_shadow.Text>, InGroup<MicrosoftTemplateShadow>; def note_template_param_here : Note<"template parameter is declared here">; def warn_template_export_unsupported : Warning< "exported templates are unsupported">; Index: clang/include/clang/Basic/DiagnosticGroups.td =================================================================== --- clang/include/clang/Basic/DiagnosticGroups.td +++ clang/include/clang/Basic/DiagnosticGroups.td @@ -1018,7 +1018,8 @@ def MicrosoftEnumValue : DiagGroup<"microsoft-enum-value">; def MicrosoftDefaultArgRedefinition : DiagGroup<"microsoft-default-arg-redefinition">; -def MicrosoftTemplate : DiagGroup<"microsoft-template">; +def MicrosoftTemplateShadow : DiagGroup<"microsoft-template-shadow">; +def MicrosoftTemplate : DiagGroup<"microsoft-template", [MicrosoftTemplateShadow]>; def MicrosoftInconsistentDllImport : DiagGroup<"inconsistent-dllimport">; def MicrosoftRedeclareStatic : DiagGroup<"microsoft-redeclare-static">; def MicrosoftEnumForwardReference :
Index: clang/test/SemaCXX/microsoft-template-shadow.cpp =================================================================== --- /dev/null +++ clang/test/SemaCXX/microsoft-template-shadow.cpp @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -verify -fms-compatibility -Wno-microsoft -Wmicrosoft-template-shadow + +template <typename T> // expected-note {{template parameter is declared here}} +struct Outmost { + template <typename T> // expected-warning {{declaration of 'T' shadows template parameter}} + struct Inner { + void f() { + T *var; + } + }; +}; Index: clang/include/clang/Basic/DiagnosticSemaKinds.td =================================================================== --- clang/include/clang/Basic/DiagnosticSemaKinds.td +++ clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -4273,7 +4273,7 @@ def err_template_param_shadow : Error< "declaration of %0 shadows template parameter">; def ext_template_param_shadow : ExtWarn< - err_template_param_shadow.Text>, InGroup<MicrosoftTemplate>; + err_template_param_shadow.Text>, InGroup<MicrosoftTemplateShadow>; def note_template_param_here : Note<"template parameter is declared here">; def warn_template_export_unsupported : Warning< "exported templates are unsupported">; Index: clang/include/clang/Basic/DiagnosticGroups.td =================================================================== --- clang/include/clang/Basic/DiagnosticGroups.td +++ clang/include/clang/Basic/DiagnosticGroups.td @@ -1018,7 +1018,8 @@ def MicrosoftEnumValue : DiagGroup<"microsoft-enum-value">; def MicrosoftDefaultArgRedefinition : DiagGroup<"microsoft-default-arg-redefinition">; -def MicrosoftTemplate : DiagGroup<"microsoft-template">; +def MicrosoftTemplateShadow : DiagGroup<"microsoft-template-shadow">; +def MicrosoftTemplate : DiagGroup<"microsoft-template", [MicrosoftTemplateShadow]>; def MicrosoftInconsistentDllImport : DiagGroup<"inconsistent-dllimport">; def MicrosoftRedeclareStatic : DiagGroup<"microsoft-redeclare-static">; def MicrosoftEnumForwardReference :
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits