================
@@ -7991,8 +7991,12 @@ Sema::CheckTemplateDeclScope(Scope *S,
TemplateParameterList *TemplateParams) {
// have C linkage.
DeclContext *Ctx = S->getEntity();
if (Ctx && Ctx->isExternCContext()) {
- Diag(TemplateParams->getTemplateLoc(), diag::err_template_linkage)
- << TemplateParams->getSourceRange();
+ SourceRange Range =
+ TemplateParams->getTemplateLoc().isInvalid() && TemplateParams->size()
+ ? TemplateParams->getParam(TemplateParams->size() - 1)
+ ->getSourceRange()
----------------
cor3ntin wrote:
Why use the last one and not the first one?
(Either getTemplateLoc is valid or all parameters are invented)
https://github.com/llvm/llvm-project/pull/129139
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits