Skip to content

Commit a5c7ab1

Browse files
committed
[nfc] Add comment describing when there may not be a parent source file.
Add a comment explaining that C++ function wont have an attached parent source file. Refs swiftlang#35311.
1 parent 99ac668 commit a5c7ab1

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)