mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[cxx-interop] [cxx-interop] Infer SWIFT_SHARED_REFERENCE for types inheriting from a C++ foreign reference type
rdar://97914474
This commit is contained in:
committed by
Fahad Nayyar
parent
c42268e7f1
commit
d8f919778d
@@ -4206,8 +4206,10 @@ void MissingMemberFailure::diagnoseUnsafeCxxMethod(SourceLoc loc,
|
||||
} else if (cxxMethod->getReturnType()->isRecordType()) {
|
||||
if (auto cxxRecord = dyn_cast<clang::CXXRecordDecl>(
|
||||
cxxMethod->getReturnType()->getAsRecordDecl())) {
|
||||
// `importerImpl` is set to nullptr here to avoid diagnostics during
|
||||
// this CxxRecordSemantics evaluation.
|
||||
auto methodSemantics = evaluateOrDefault(
|
||||
ctx.evaluator, CxxRecordSemantics({cxxRecord, ctx}), {});
|
||||
ctx.evaluator, CxxRecordSemantics({cxxRecord, ctx, nullptr}), {});
|
||||
if (methodSemantics == CxxRecordSemanticsKind::Iterator) {
|
||||
ctx.Diags.diagnose(loc, diag::iterator_method_unavailable,
|
||||
name.getBaseIdentifier().str());
|
||||
|
||||
Reference in New Issue
Block a user