Skip to content

Commit ee2a7ee

Browse files
committed
[nfc][cxx-interop] Add diagnostics for invalid custom reference counting operations.
1 parent b443dfc commit ee2a7ee

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

include/swift/AST/DiagnosticsIRGen.def

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,19 @@ ERROR(temporary_allocation_alignment_not_positive,none,
5959
ERROR(temporary_allocation_alignment_not_power_of_2,none,
6060
"alignment value must be a power of two", ())
6161

62-
ERROR(foreign_reference_types_unsupported,none,
63-
"attempt to use a foreign reference type in a generic context. "
64-
"Foreign reference types are currently not supported. Using foreign "
65-
"reference types in a generic context is not yet implemented.", ())
62+
ERROR(foreign_reference_types_cannot_find_retain,none,
63+
"cannot find retain function '%0'.", (StringRef))
64+
65+
ERROR(foreign_reference_types_cannot_find_release,none,
66+
"cannot find release function '%0'.", (StringRef))
67+
68+
ERROR(foreign_reference_types_invalid_retain,none,
69+
"specified retain function '%0' is invalid. Retain must have exactly one "
70+
"argument of type '%1'", (StringRef, StringRef))
71+
72+
ERROR(foreign_reference_types_invalid_release,none,
73+
"specified release function '%0' is invalid. Release must have exactly "
74+
"one argument of type '%1'", (StringRef, StringRef))
6675

6776
#define UNDEFINE_DIAGNOSTIC_MACROS
6877
#include "DefineDiagnosticMacros.h"

lib/ClangImporter/ImportDecl.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2418,6 +2418,8 @@ namespace {
24182418
}
24192419
}
24202420

2421+
2422+
24212423
result->setMemberLoader(&Impl, 0);
24222424
return result;
24232425
}

0 commit comments

Comments
 (0)