swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.6k stars 10.37k forks source link

[cxx-interop] Add diagnostic notes when retain/release are not import… #76733

Closed fahadnayyar closed 1 month ago

fahadnayyar commented 1 month ago

If the retain or release function of a C++ foreign reference type (or SWIFT_SHARED_REFERENCE type) was not imported into swift because of any reasons, then we were just emitting this error: cannot find retain/release function '<retain/release function name>' for reference type ''.

This is confusing to a C++ developer because the retain/release function clearly exists on C++ side. It is just not imported into swift because it violated some contract.

In this patch I am adding additional notes in such cases when retain/release functions are actually present on the C++ side, but are not imported into swift for whatever reason.

rdar://136834573

fahadnayyar commented 1 month ago

@swift-ci please smoke test

fahadnayyar commented 1 month ago

@swift-ci please smoke test