Skip to content

Commit

Permalink
[饾榾饾椊饾椏] initial version
Browse files Browse the repository at this point in the history
Created using spr 1.3.5
  • Loading branch information
bogner committed Nov 4, 2023
1 parent b53c04a commit cab6bcd
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 53 deletions.
2 changes: 1 addition & 1 deletion clang/lib/Sema/SemaDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5929,7 +5929,7 @@ Sema::GetNameFromUnqualifiedId(const UnqualifiedId &Name) {
Diag(Name.StartLocation,
diag::err_deduction_guide_name_not_class_template)
<< (int)getTemplateNameKindForDiagnostics(TN) << TN;
if (Template)
if (Template && Template->getLocation().isValid())
Diag(Template->getLocation(), diag::note_template_decl_here);
return DeclarationNameInfo();
}
Expand Down
3 changes: 2 additions & 1 deletion clang/lib/Sema/SemaDeclCXX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11462,7 +11462,8 @@ bool Sema::CheckDeductionGuideDeclarator(Declarator &D, QualType &R,
GuidedTemplateDecl->getDeclContext()->getRedeclContext())) {
Diag(D.getIdentifierLoc(), diag::err_deduction_guide_wrong_scope)
<< GuidedTemplateDecl;
Diag(GuidedTemplateDecl->getLocation(), diag::note_template_decl_here);
if (GuidedTemplateDecl->getLocation().isValid())
Diag(GuidedTemplateDecl->getLocation(), diag::note_template_decl_here);
}

auto &DS = D.getMutableDeclSpec();
Expand Down
3 changes: 2 additions & 1 deletion clang/lib/Sema/SemaInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10575,7 +10575,8 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer(
diag::err_deduced_non_class_template_specialization_type)
<< (int)getTemplateNameKindForDiagnostics(TemplateName) << TemplateName;
if (auto *TD = TemplateName.getAsTemplateDecl())
Diag(TD->getLocation(), diag::note_template_decl_here);
if (TD->getLocation().isValid())
Diag(TD->getLocation(), diag::note_template_decl_here);
return QualType();
}

Expand Down
3 changes: 2 additions & 1 deletion clang/lib/Sema/SemaLambda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,8 @@ void Sema::ActOnStartOfLambdaDefinition(LambdaIntroducer &Intro,
for (const auto &Capture : Intro.Captures) {
if (Capture.Id == TP->getIdentifier()) {
Diag(Capture.Loc, diag::err_template_param_shadow) << Capture.Id;
Diag(TP->getLocation(), diag::note_template_param_here);
if (TP->getLocation().isValid())
Diag(TP->getLocation(), diag::note_template_param_here);
}
}
}
Expand Down

0 comments on commit cab6bcd

Please sign in to comment.