Skip to content

Commit 4ca4b9a

Browse files
committed
[cxx-interop] Check for type completeness consistently
`clangSema.isCompleteType` checks for decl visibility according to the module visibility rules, which we don't actually need. What we need to check is whether the record has a definition – this is the check we already use elsewhere in ClangImporter. This makes sure that we can import `std::function` on Windows. rdar://103979602
1 parent 2d0863a commit 4ca4b9a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2959,9 +2959,7 @@ namespace {
29592959
if (notInstantiated)
29602960
return nullptr;
29612961
}
2962-
if (!clangSema.isCompleteType(
2963-
decl->getLocation(),
2964-
Impl.getClangASTContext().getRecordType(decl))) {
2962+
if (!decl->getDefinition()) {
29652963
// If we got nullptr definition now it means the type is not complete.
29662964
// We don't import incomplete types.
29672965
return nullptr;

0 commit comments

Comments
 (0)