Skip to content

Commit e761d9a

Browse files
authored
Merge pull request #70097 from apple/egorzhdan/base-method-cast
[cxx-interop] Do not crash when synthesizing a base method call
2 parents 1c3bd3e + d3460cb commit e761d9a

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)