diff options
author | Tomasz Kamiński <tomasz.kamiński@sonarsource.com> | 2023-03-27 10:13:20 +0200 |
---|---|---|
committer | Tomasz Kamiński <tomasz.kamiński@sonarsource.com> | 2023-03-27 12:22:06 +0200 |
commit | a826b9034bbd046a5d0708ba656a3d345d179920 (patch) | |
tree | 5cf0c98d97d2fd59dd5ff263574a485b1990d677 /llvm/unittests/CodeGen/MachineInstrTest.cpp | |
parent | 9580bebd47808b58f8ab833d71d2d38976caa9b8 (diff) | |
download | llvm-a826b9034bbd046a5d0708ba656a3d345d179920.zip llvm-a826b9034bbd046a5d0708ba656a3d345d179920.tar.gz llvm-a826b9034bbd046a5d0708ba656a3d345d179920.tar.bz2 |
[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
Diffstat (limited to 'llvm/unittests/CodeGen/MachineInstrTest.cpp')
0 files changed, 0 insertions, 0 deletions