Skip to content

Commit 17d5d10

Browse files
author
David Ungar
authored
Merge pull request #28036 from davidungar/astscope-boundary-condition
[NameLookup, ASTScope] Fix boundary condition test in scope search.
2 parents 3671cab + 3cd1d9a commit 17d5d10

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/AST/ASTScopeLookup.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ ASTScopeImpl::findChildContaining(SourceLoc loc,
157157
}
158158
bool operator()(SourceLoc loc, const ASTScopeImpl *scope) {
159159
ASTScopeAssert(scope->checkSourceRangeOfThisASTNode(), "Bad range.");
160-
return sourceMgr.isBeforeInBuffer(loc,
161-
scope->getSourceRangeOfScope().End);
160+
return !sourceMgr.isBeforeInBuffer(scope->getSourceRangeOfScope().End,
161+
loc);
162162
}
163163
};
164164
auto *const *child = std::lower_bound(

0 commit comments

Comments
 (0)