Skip to content

Commit 60495c2

Browse files
mizvekovBrock Denson
authored andcommitted
[clang] fix source range computation for DeducedTemplateSpecializationType (llvm#153646)
This was a regression introduced in llvm#147835 Since this regression was never released, there are no release notes. Fixes llvm#153540
1 parent bc3af88 commit 60495c2

File tree

2 files changed

+978
-0
lines changed

2 files changed

+978
-0
lines changed

clang/include/clang/AST/TypeLoc.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2519,6 +2519,15 @@ class DeducedTemplateSpecializationTypeLoc
25192519
getLocalData()->QualifierData = QualifierLoc.getOpaqueData();
25202520
}
25212521

2522+
SourceRange getLocalSourceRange() const {
2523+
SourceLocation BeginLoc = getElaboratedKeywordLoc();
2524+
if (BeginLoc.isInvalid())
2525+
BeginLoc = getQualifierLoc().getBeginLoc();
2526+
if (BeginLoc.isInvalid())
2527+
BeginLoc = getNameLoc();
2528+
return {BeginLoc, getNameLoc()};
2529+
}
2530+
25222531
void initializeLocal(ASTContext &Context, SourceLocation Loc);
25232532
};
25242533

0 commit comments

Comments
 (0)