You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[cxx-interop] Assume that plain-C enums are resilient
This fixes sudden compiler errors that are emitted when trying to use CoreText.framework with C++ interop enabled.
When Swift is trying to rebuild a dependency module from its textual interface, it should not complain on usages of C enums in public Swift APIs.
This still leaves the resilience safety guardrail enabled for C++ scoped enums.
rdar://143215914
(cherry picked from commit 00e6b36)
Copy file name to clipboardExpand all lines: test/Interop/Cxx/library-evolution/allow-c-in-cxx-mode-in-evolving-libraries.swift
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,14 @@ public:
17
17
void method() const;
18
18
};
19
19
20
+
enumCEnum{
21
+
a, b
22
+
};
23
+
24
+
enumclass CxxEnum {
25
+
aa, bb
26
+
};
27
+
20
28
#if defined(__cplusplus)
21
29
extern "C"{
22
30
#endif
@@ -36,6 +44,12 @@ import CxxModule
36
44
publicfunc useCStruct(_ x:CStruct){
37
45
}
38
46
47
+
publicfunc useCEnum(_ x:CEnum){
48
+
}
49
+
50
+
publicfunc useCxxEnum(_ x:CxxEnum){ // expected-error {{cannot use enum 'CxxEnum' here; C++ types from imported module 'CxxModule' do not support library evolution}}
51
+
}
52
+
39
53
// expected-error@+1 {{cannot use struct 'CxxStruct' here; C++ types from imported module 'CxxModule' do not support library evolution}}
0 commit comments