Skip to content

Commit e986a15

Browse files
committed
[AST] Fix accessor end locations.
They shouldn’t involve the parameter list, because they aren’t present.
1 parent b56bb3d commit e986a15

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/AST/Decl.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4583,9 +4583,12 @@ SourceRange FuncDecl::getSourceRange() const {
45834583
if (!B->isImplicit())
45844584
return { StartLoc, B->getEndLoc() };
45854585
}
4586+
4587+
if (this->isAccessor())
4588+
return StartLoc;
4589+
45864590
if (getBodyResultTypeLoc().hasLocation() &&
4587-
getBodyResultTypeLoc().getSourceRange().End.isValid() &&
4588-
!this->isAccessor())
4591+
getBodyResultTypeLoc().getSourceRange().End.isValid())
45894592
return { StartLoc, getBodyResultTypeLoc().getSourceRange().End };
45904593
auto LastParamListEndLoc = getParameterLists().back()->getSourceRange().End;
45914594
if (LastParamListEndLoc.isValid())

0 commit comments

Comments
 (0)