Commit 7fcdee6
committed
[cxx-interop] Tweak C++ type semantics detection
`CxxRecordSemanticsKind::ExplicitlyUnsafe` and `CxxRecordSemanticsKind::UnsafePointerMember` were never directly used, and those do not indicate semantics: they indicate safety of the type when used from Swift, which should be handled by another request `IsSafeUseOfCxxDecl` instead of `CxxRecordSemantics`.
Having `ExplicitlyUnsafe` and `UnsafePointerMember` as semantics indicators was problematic, for instance, for types that are move-only and store a pointer at the same time. Swift allowed the usage of these types (under the rules for `UnsafePointerMember` types) when move-only types are disabled, and did not apply the move-only attribute on such types when move-only types are enabled.
rdar://110644300
(cherry picked from commit 6e7fb32)1 parent 6f1cf76 commit 7fcdee6
File tree
5 files changed
+34
-17
lines changed- include/swift/ClangImporter
- lib
- ClangImporter
- Sema
- test/Interop/Cxx/class
- Inputs
5 files changed
+34
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | 309 | | |
313 | 310 | | |
314 | | - | |
315 | | - | |
316 | 311 | | |
317 | 312 | | |
318 | 313 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6665 | 6665 | | |
6666 | 6666 | | |
6667 | 6667 | | |
6668 | | - | |
6669 | | - | |
6670 | | - | |
6671 | | - | |
6672 | 6668 | | |
6673 | 6669 | | |
6674 | 6670 | | |
| |||
6677 | 6673 | | |
6678 | 6674 | | |
6679 | 6675 | | |
6680 | | - | |
6681 | | - | |
6682 | | - | |
6683 | | - | |
6684 | | - | |
6685 | 6676 | | |
6686 | 6677 | | |
6687 | 6678 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4012 | 4012 | | |
4013 | 4013 | | |
4014 | 4014 | | |
4015 | | - | |
4016 | | - | |
4017 | | - | |
4018 | 4015 | | |
4019 | 4016 | | |
4020 | 4017 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
115 | 129 | | |
116 | 130 | | |
117 | 131 | | |
| |||
148 | 162 | | |
149 | 163 | | |
150 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
151 | 181 | | |
152 | 182 | | |
153 | 183 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
0 commit comments