Merge pull request #85021 from j-hui/return-frt-diagnostics

[cxx-interop] Put RETURNS_RETAINED warnings in a diagnostic group

rdar://161932849
rdar://144976203
This commit is contained in:
John Hui
2025-10-24 12:05:48 -04:00
committed by GitHub
20 changed files with 195 additions and 92 deletions

View File

@@ -2211,12 +2211,12 @@ ERROR(expose_nested_type_to_cxx,none,
"nested %kind0 can not yet be represented in C++", (ValueDecl *))
ERROR(expose_macro_to_cxx,none,
"Swift macro can not yet be represented in C++", (ValueDecl *))
WARNING(warn_unannotated_cxx_func_returning_frt, none,
"cannot infer the ownership of the returned value, annotate %0 with "
"either SWIFT_RETURNS_RETAINED or SWIFT_RETURNS_UNRETAINED",
GROUPED_WARNING(warn_unannotated_cxx_func_returning_frt, ForeignReferenceType, none,
"cannot infer ownership of foreign reference value returned by %0",
(const ValueDecl *))
NOTE(note_unannotated_cxx_func_returning_frt, none,
"annotate %0 with either SWIFT_RETURNS_RETAINED or SWIFT_RETURNS_UNRETAINED",
(const ValueDecl *))
NOTE(note_unannotated_cxx_func_returning_frt, none, "%0 is defined here",
(const ValueDecl *))
ERROR(unexposed_other_decl_in_cxx,none,
"%kind0 is not yet exposed to C++", (ValueDecl *))
ERROR(unsupported_other_decl_in_cxx,none,