Skip to content

Commit

Permalink
Fix segfault with undefined template declaration errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Etienne Cimon committed Sep 22, 2014
1 parent 0588458 commit ca333f4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/template.c
Original file line number Diff line number Diff line change
Expand Up @@ -7324,10 +7324,13 @@ bool TemplateInstance::findBestMatch(Scope *sc, Expressions *fargs)
else if (tdecl && !tdecl->overnext)
// Only one template, so we can give better error message
error("does not match template declaration %s", tdecl->toChars());
else
else if (tempdecl->parent)
::error(loc, "%s %s.%s does not match any template declaration",
tempdecl->kind(), tempdecl->parent->toPrettyChars(), tempdecl->ident->toChars());
return false;
else
::error(loc, "%s %s does not match any template declaration",
tempdecl->kind(), tempdecl->ident->toChars());
return false;
}

/* The best match is td_last
Expand Down

0 comments on commit ca333f4

Please sign in to comment.