Skip to content

Commit fcd7289

Browse files
committed
[cxx-interop] Suggest 'self_contained' fixit on return type, not parent.
1 parent d9a063c commit fcd7289

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/Sema/CSDiagnostics.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3968,10 +3968,6 @@ void MissingMemberFailure::diagnoseUnsafeCxxMethod(SourceLoc loc,
39683968
->getName()
39693969
.str();
39703970

3971-
auto baseClangLoc = cxxMethod->getParent()->getLocation();
3972-
auto baseSwiftLoc =
3973-
ctx.getClangModuleLoader()->importSourceLocation(baseClangLoc);
3974-
39753971
auto methodClangLoc = cxxMethod->getLocation();
39763972
auto methodSwiftLoc =
39773973
ctx.getClangModuleLoader()->importSourceLocation(methodClangLoc);
@@ -4083,6 +4079,10 @@ void MissingMemberFailure::diagnoseUnsafeCxxMethod(SourceLoc loc,
40834079
} else {
40844080
assert(methodSemantics ==
40854081
CxxRecordSemanticsKind::UnsafePointerMember);
4082+
4083+
auto baseSwiftLoc = ctx.getClangModuleLoader()->importSourceLocation(
4084+
cxxRecord->getLocation());
4085+
40864086
ctx.Diags.diagnose(loc, diag::projection_value_not_imported,
40874087
name.getBaseIdentifier().str(), returnTypeStr);
40884088
ctx.Diags.diagnose(loc, diag::projection_may_return_interior_ptr,

0 commit comments

Comments
 (0)