File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -3202,13 +3202,16 @@ namespace {
32023202
32033203 if (auto recordType = dyn_cast<clang::RecordType>(
32043204 decl->getReturnType ().getCanonicalType ())) {
3205- Impl.addImportDiagnostic (
3206- decl, Diagnostic (diag::reference_passed_by_value,
3207- Impl.SwiftContext .AllocateCopy (
3208- recordType->getDecl ()->getNameAsString ()),
3209- " the return" ),
3210- decl->getLocation ());
3211- return recordHasReferenceSemantics (recordType->getDecl ());
3205+ if (recordHasReferenceSemantics (recordType->getDecl ())) {
3206+ Impl.addImportDiagnostic (
3207+ decl,
3208+ Diagnostic (diag::reference_passed_by_value,
3209+ Impl.SwiftContext .AllocateCopy (
3210+ recordType->getDecl ()->getNameAsString ()),
3211+ " the return" ),
3212+ decl->getLocation ());
3213+ return true ;
3214+ }
32123215 }
32133216
32143217 return false ;
You can’t perform that action at this time.
0 commit comments