Commit b6fce85
Gabor Horvath
[cxx-interop] Fix spurious lifetime dependence errors
ClangImporter will generate value and default initializers for certain
structs imported from C++. These generated initializers have no
associated lifetime dependence information so they will trigger spurious
errors for non-escapable types. This patch makes sure these are marked
as unsafe so the type checker will not generate errors for them.
Moreover, the generated default initializer would trigger a crash for
non-escapable types as the builtin to zero initialize an object does not
support non-escapable types yet.
rdar://1430408621 parent 4d24b7d commit b6fce85
File tree
2 files changed
+47
-12
lines changed- lib/ClangImporter
- test/Interop/Cxx/class
2 files changed
+47
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2041 | 2041 | | |
2042 | 2042 | | |
2043 | 2043 | | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
2044 | 2056 | | |
2045 | 2057 | | |
2046 | 2058 | | |
| |||
2236 | 2248 | | |
2237 | 2249 | | |
2238 | 2250 | | |
| 2251 | + | |
2239 | 2252 | | |
2240 | 2253 | | |
2241 | 2254 | | |
2242 | 2255 | | |
2243 | 2256 | | |
2244 | 2257 | | |
| 2258 | + | |
2245 | 2259 | | |
2246 | 2260 | | |
2247 | 2261 | | |
| |||
2386 | 2400 | | |
2387 | 2401 | | |
2388 | 2402 | | |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
2389 | 2406 | | |
2390 | 2407 | | |
2391 | 2408 | | |
| |||
2410 | 2427 | | |
2411 | 2428 | | |
2412 | 2429 | | |
2413 | | - | |
| 2430 | + | |
| 2431 | + | |
| 2432 | + | |
| 2433 | + | |
| 2434 | + | |
| 2435 | + | |
| 2436 | + | |
2414 | 2437 | | |
2415 | 2438 | | |
2416 | 2439 | | |
| |||
2423 | 2446 | | |
2424 | 2447 | | |
2425 | 2448 | | |
2426 | | - | |
2427 | 2449 | | |
2428 | 2450 | | |
2429 | 2451 | | |
| |||
2433 | 2455 | | |
2434 | 2456 | | |
2435 | 2457 | | |
| 2458 | + | |
2436 | 2459 | | |
2437 | 2460 | | |
2438 | 2461 | | |
| |||
2462 | 2485 | | |
2463 | 2486 | | |
2464 | 2487 | | |
| 2488 | + | |
| 2489 | + | |
| 2490 | + | |
2465 | 2491 | | |
2466 | 2492 | | |
2467 | 2493 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| |||
105 | 104 | | |
106 | 105 | | |
107 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
108 | 111 | | |
109 | 112 | | |
110 | 113 | | |
| |||
120 | 123 | | |
121 | 124 | | |
122 | 125 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
129 | 132 | | |
130 | 133 | | |
131 | 134 | | |
132 | | - | |
133 | | - | |
134 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
135 | 140 | | |
136 | 141 | | |
137 | 142 | | |
| |||
155 | 160 | | |
156 | 161 | | |
157 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
0 commit comments