Clang uses the location identifier should be inserted for declarator
decls when a decl is unnamed. But for type template and template template
paramaters it uses the location of "typename/class" keyword, which makes it hard
for tooling to insert/change parameter names.
This change tries to unify these two cases by making template parameter
parsing and sourcerange operations similar to function params/declarator decls.
getName() may fail if the name is not an identifier.
Even though this shouldn't happen for TypeDecls, could you please change to getDeclName().isEmpty()?
It's equivalent and does not have any assertions.