Skip to content

Commit f4436f4

Browse files
authored
Merge pull request swiftlang#35364 from zoecarver/cxx/follow-up-35311
[nfc] Add comment describing when there may not be a parent source file.
2 parents e26ba4c + a5c7ab1 commit f4436f4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/AST/ASTScopeCreation.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ void ASTScope::
209209
}
210210

211211
void ASTScope::expandFunctionBody(AbstractFunctionDecl *AFD) {
212+
// There is no source file associated with C++ decl contexts, so there will
213+
// be no parent source file if AFD is a C++ function.
212214
if (auto *const SF = AFD->getParentSourceFile())
213215
SF->getScope().expandFunctionBodyImpl(AFD);
214216
}

0 commit comments

Comments
 (0)