Skip to content

Conversation

j-hui
Copy link
Contributor

@j-hui j-hui commented Oct 21, 2025

This PR rebases and addresses feedback from #84759 and includes some additional refinements:

  • Rewrites some of the documentation to be less C++-specific
  • Rewords the diagnostics slightly
  • Cleans up some tests + test C interop scenario

rdar://161932849
rdar://144976203

fahadnayyar and others added 6 commits October 17, 2025 17:06
…d add it to a diagnostic group

This change makes the warning for unannotated C++ functions returning foreign
reference types (FRT) enabled by default, improving memory safety for Swift/C++
interop users. Also added CxxForeignReferenceType diagnostic group for better control
- Delete baseline language feature WarnUnannotatedReturnOfCxxFrt,
  which won't really be useful to users
- Remove some references to "cxx", since FRTs are not exclusively
  imported from C++
- Clean up lit test RUN lines to use %{fs-sep}
Several changes:

- shorten the warning at the call-site of unannotated functions that
  return FRTS
- place the call to action ("annotate 'X' with 'Y'") at the diagnostic
  note attached to the unannotated callee, where the annotation should
  be made
- re-word the foreign-reference-type.md documentation to (1) reflect the
  diagnostic wording change, (2) give a little bit more background about
  why the annotations are needed, and (3) not be specific to C++ (since
  we can import FRTs from C as well)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants