Update lib/Sema/TypeCheckMacros.cpp

Co-authored-by: John Hui <updog@j-hui.com>
This commit is contained in:
Henrik G. Olsson
2025-11-10 19:18:35 -08:00
committed by GitHub
parent 7025b03449
commit 959d6a656b

View File

@@ -1374,8 +1374,8 @@ static SourceFile *evaluateAttachedMacro(MacroDecl *macro, Decl *attachedTo,
dc = attachedTo->getDeclContext();
if (!isa<ClangModuleUnit>(dc->getModuleScopeContext()))
dc = dc->getParentSourceFile();
else // decls imported from clang do not have a SourceFile
ASSERT(isa<FileUnit>(dc) && !isa<SourceFile>(dc));
else
ASSERT(isa<FileUnit>(dc) && !isa<SourceFile>(dc) && "decls imported from Clang should not have a SourceFile");
} else {
dc = attachedTo->getInnermostDeclContext();
}