When the diagnosed function/variable is a template specialization, the source range covers the specialization arguments.
e.g.
warning: unused function 'func<int>' [-Wunused-function] template <> int func<int> () {} ^~~~~~~~~
This comes in line with the printed text in the warning message. In the above case, func<int>
Does DiagD->getSourceRange() not give you the same results?