This patch adjust the getSourceRange() for the
VarTemplateSpecializationDecl and VarTemplatePartialSpecializationDecl,
such that the initializer is included if present:
template<typename T> T temp = 1; template<> double temp<double> = 1;
This patch makes it consistent with the behavior of
non-template variables with initializers and restores
behavior that was present before https://reviews.llvm.org/D139705.
n case, when the initializer is not present we still
include the template arguments in the source range,
which was required for fixing zero-initialization fix-it.
Looking closer... VarDecl already includes its init in its source range, right? So perhaps all that needs to happen here is to have the isExplicitSpecialization check be :
isExplicitSpecialization() && !hasInit()
WDYT?