Skip to content

Commit d3460cb

Browse files
committed
[cxx-interop] Do not crash when synthesizing a base method call
rdar://114823867
1 parent d5ef460 commit d3460cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4978,7 +4978,7 @@ FuncDecl *synthesizeBaseFunctionDeclCall(ClangImporter &impl, ASTContext &ctx,
49784978
cast<clang::CXXRecordDecl>(baseStruct->getClangDecl()), cxxMethod);
49794979
if (!newClangMethod)
49804980
return nullptr;
4981-
return cast<FuncDecl>(
4981+
return cast_or_null<FuncDecl>(
49824982
ctx.getClangModuleLoader()->importDeclDirectly(newClangMethod));
49834983
}
49844984

0 commit comments

Comments
 (0)