================
@@ -885,16 +885,19 @@ bool Sema::DiagnoseUninstantiableTemplate(SourceLocation 
PointOfInstantiation,
 /// that the template parameter 'PrevDecl' is being shadowed by a new
 /// declaration at location Loc. Returns true to indicate that this is
 /// an error, and false otherwise.
-void Sema::DiagnoseTemplateParameterShadow(SourceLocation Loc, Decl *PrevDecl) 
{
+void Sema::DiagnoseTemplateParameterShadow(SourceLocation Loc, Decl *PrevDecl,
+                                           bool IssueWarning) {
----------------
sdkrystian wrote:

I think the more generic `IssueWarning` is less ambiguous. We only issue the 
warning for variable/function templates the shadow _their own_ template 
parameters. For example:
```cpp
template<typename T>
struct A
{
    template<typename U> void U(); // warning
    template<typename U> void T(); // error
    void T(); // error
};
```
`ShadowsFunctionOrVariableName` establishes the expectation that its value will 
be `true` for all the above function declarations (its only `true` for the 
first one).

https://github.com/llvm/llvm-project/pull/79683
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to