This patch re-enables diagnostics for unannotated C++ functions or
methods returning `SWIFT_SHARED_REFERENCE` types. These warnings now
fire only **once per source location**, even in the presence of multiple
template instantiations. This avoids diagnostic duplication that was a
key source of noise in the compilation of larger codebases.
These warnings were previously disabled starting in **Swift 6.2** via
[PR-#81411](https://github.com/swiftlang/swift/pull/81411) due to
concerns around false positives and excessive duplication in projects
adopting C++ interop. This patch addresses the duplication issue by
adding source-location-based caching, which ensures that a warning is
emitted only once per source location, even across template
instantiations with different types.
However, the false positive issue remains to be investigated and will be
addressed in a follow-up patch. Until that happens, the warnings are
gated behind a new experimental feature flag:
`WarnUnannotatedReturnOfCxxFrt`. This feature will be enabled by default
only after thorough qualification and testing on large C++ codebases.
rdar://154261051
These previously failed because they used '/' as the path separator
instead of '\'. While both are accepted on Windows, the latter is
preferred and used to construct new paths, such as the path of imported
header files. This inconsistency led to distinct buffer ID numbers being
created (since paths are not canonicalized in BufferIdentIDMap), leading
-verify to fail to associate the error emitted from the included file
with the error expected in the -verify-additional-file file.
This patch re-enables these tests but uses %{fs-sep} in place of '/', to
ensure the appropriate path separator is used for the platform where the
test is run.
rdar://148928101