@@ -11833,7 +11833,7 @@ class Sema final : public SemaBase {
1183311833 bool *ConstraintsNotSatisfied = nullptr);
1183411834
1183511835 bool CheckTemplateTypeArgument(
11836- TemplateArgumentLoc &Arg,
11836+ TemplateTypeParmDecl *Param, TemplateArgumentLoc &Arg,
1183711837 SmallVectorImpl<TemplateArgument> &SugaredConverted,
1183811838 SmallVectorImpl<TemplateArgument> &CanonicalConverted);
1183911839
@@ -11869,13 +11869,9 @@ class Sema final : public SemaBase {
1186911869 bool PartialOrdering,
1187011870 bool *StrictPackMatch);
1187111871
11872- /// Print the given named declaration to a string,
11873- /// using the current PrintingPolicy, except that
11874- /// TerseOutput will always be set.
11875- SmallString<128> toTerseString(const NamedDecl &D) const;
11876-
1187711872 void NoteTemplateLocation(const NamedDecl &Decl,
1187811873 std::optional<SourceRange> ParamRange = {});
11874+ void NoteTemplateParameterLocation(const NamedDecl &Decl);
1187911875
1188011876 /// Given a non-type template argument that refers to a
1188111877 /// declaration and the type of its corresponding non-type template
@@ -11990,13 +11986,15 @@ class Sema final : public SemaBase {
1199011986 bool TemplateParameterListsAreEqual(
1199111987 const TemplateCompareNewDeclInfo &NewInstFrom, TemplateParameterList *New,
1199211988 const NamedDecl *OldInstFrom, TemplateParameterList *Old, bool Complain,
11993- TemplateParameterListEqualKind Kind);
11989+ TemplateParameterListEqualKind Kind,
11990+ SourceLocation TemplateArgLoc = SourceLocation());
1199411991
11995- bool TemplateParameterListsAreEqual(TemplateParameterList *New,
11996- TemplateParameterList *Old, bool Complain,
11997- TemplateParameterListEqualKind Kind) {
11992+ bool TemplateParameterListsAreEqual(
11993+ TemplateParameterList *New, TemplateParameterList *Old, bool Complain,
11994+ TemplateParameterListEqualKind Kind,
11995+ SourceLocation TemplateArgLoc = SourceLocation()) {
1199811996 return TemplateParameterListsAreEqual(nullptr, New, nullptr, Old, Complain,
11999- Kind);
11997+ Kind, TemplateArgLoc );
1200011998 }
1200111999
1200212000 /// Check whether a template can be declared within this scope.
@@ -12876,11 +12874,6 @@ class Sema final : public SemaBase {
1287612874
1287712875 /// We are performing partial ordering for template template parameters.
1287812876 PartialOrderingTTP,
12879-
12880- /// We are Checking a Template Parameter, so for any diagnostics which
12881- /// occur in this scope, we will add a context note which points to this
12882- /// template parameter.
12883- CheckTemplateParameter,
1288412877 } Kind;
1288512878
1288612879 /// Was the enclosing context a non-instantiation SFINAE context?
@@ -13108,11 +13101,6 @@ class Sema final : public SemaBase {
1310813101 PartialOrderingTTP, TemplateDecl *PArg,
1310913102 SourceRange InstantiationRange = SourceRange());
1311013103
13111- struct CheckTemplateParameter {};
13112- /// \brief Note that we are checking a template parameter.
13113- InstantiatingTemplate(Sema &SemaRef, CheckTemplateParameter,
13114- NamedDecl *Param);
13115-
1311613104 /// Note that we have finished instantiating this template.
1311713105 void Clear();
1311813106
@@ -13146,13 +13134,6 @@ class Sema final : public SemaBase {
1314613134 InstantiatingTemplate &operator=(const InstantiatingTemplate &) = delete;
1314713135 };
1314813136
13149- /// For any diagnostics which occur within its scope, adds a context note
13150- /// pointing to the declaration of the template parameter.
13151- struct CheckTemplateParameterRAII : InstantiatingTemplate {
13152- CheckTemplateParameterRAII(Sema &S, NamedDecl *Param)
13153- : InstantiatingTemplate(S, CheckTemplateParameter(), Param) {}
13154- };
13155-
1315613137 bool SubstTemplateArgument(const TemplateArgumentLoc &Input,
1315713138 const MultiLevelTemplateArgumentList &TemplateArgs,
1315813139 TemplateArgumentLoc &Output,
0 commit comments