Skip to content
Commit a826b903 authored by Tomasz Kamiński's avatar Tomasz Kamiński
Browse files

[clang] source range of variable template specialization should include initializer

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.

Reviewed By: erichkeane

Differential Revision: https://reviews.llvm.org/D146733
parent 9580bebd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment