Skip to content

Commit eeada0d

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

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)