Right now when a template is instantiated more times and there is a bug in the instantiations the issue hash will be different for each instantiation even if every other property of the bug (path, message, location) is the same.
This patch aims to resolve this issue. Note that explicit specializations still generate different hashes but that is intended.
Could we use here FunctionDecl::getPrimaryTemplate() ? That seems more general, it handles both specializations and instantiations.