Commit 7c49480
committed
[cxx-interop] Avoid diagnosing missing lifetime operations in symbolic mode
When importing C++ decls in symbolic mode, class templates are not instantiated, which means they might not have a destructor or a move constructor. Make sure we are not trying to diagnose those missing lifetime operations in symbolic mode.
This fixes incorrect diagnostics that were emitted during indexing at the end of compilation:
```
warning: 'import_owned' Swift attribute ignored on type 'basic_string': type is not copyable or destructible
```
As a nice side effect, this moves the logic that emits these diagnostics from the request body, which might be invoked many times, to the importer itself, which is only invoked once per C++ class.
rdar://1474217101 parent 922a01d commit 7c49480
File tree
6 files changed
+28
-30
lines changed- include/swift/ClangImporter
- lib/ClangImporter
- test/Interop/Cxx/symbolic-imports
6 files changed
+28
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | 363 | | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
| 364 | + | |
| 365 | + | |
373 | 366 | | |
374 | 367 | | |
375 | 368 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7953 | 7953 | | |
7954 | 7954 | | |
7955 | 7955 | | |
7956 | | - | |
| 7956 | + | |
7957 | 7957 | | |
7958 | 7958 | | |
7959 | 7959 | | |
7960 | 7960 | | |
7961 | 7961 | | |
7962 | 7962 | | |
7963 | 7963 | | |
7964 | | - | |
| 7964 | + | |
7965 | 7965 | | |
7966 | 7966 | | |
7967 | 7967 | | |
| |||
8197 | 8197 | | |
8198 | 8198 | | |
8199 | 8199 | | |
8200 | | - | |
8201 | | - | |
8202 | | - | |
8203 | | - | |
8204 | | - | |
8205 | | - | |
8206 | | - | |
8207 | | - | |
8208 | | - | |
8209 | | - | |
8210 | | - | |
8211 | | - | |
8212 | 8200 | | |
8213 | 8201 | | |
8214 | 8202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | 176 | | |
181 | 177 | | |
182 | | - | |
183 | | - | |
| 178 | + | |
184 | 179 | | |
185 | 180 | | |
186 | 181 | | |
| |||
2978 | 2973 | | |
2979 | 2974 | | |
2980 | 2975 | | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
| 2986 | + | |
2981 | 2987 | | |
2982 | 2988 | | |
2983 | 2989 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2051 | 2051 | | |
2052 | 2052 | | |
2053 | 2053 | | |
| 2054 | + | |
2054 | 2055 | | |
| 2056 | + | |
2055 | 2057 | | |
2056 | 2058 | | |
2057 | 2059 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
63 | 68 | | |
64 | 69 | | |
65 | 70 | | |
| |||
73 | 78 | | |
74 | 79 | | |
75 | 80 | | |
| 81 | + | |
| 82 | + | |
76 | 83 | | |
77 | 84 | | |
78 | 85 | | |
| |||
0 commit comments