Commit 45ecf12
authored
[C++ Safe Buffers][BoundsSafety] Fix that some interop diagnostics cannot be suppressed by __unsafe_buffer_usage_begin/end (swiftlang#10206)
The interop diagnostics emitted in Sema cannot be suppressed by
`#pragma clang unsafe_buffer_usage begin/end`. This is because the
opt-out regions marked by those pragmas are stored in Preprocessor not
DiagnosticsEngine. We need query both the Preprocessor and
DiagnosticsEngine to confirm if C++ Safe Buffers is enabled at a
location. This commit fixes this problem.
(rdar://146438364)
(cherry picked from commit 87da2d5)1 parent 1c65036 commit 45ecf12
File tree
4 files changed
+51
-4
lines changed- clang
- include/clang
- Lex
- Sema
- lib/Sema
- test/SemaCXX
4 files changed
+51
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3018 | 3018 | | |
3019 | 3019 | | |
3020 | 3020 | | |
| 3021 | + | |
| 3022 | + | |
| 3023 | + | |
| 3024 | + | |
| 3025 | + | |
3021 | 3026 | | |
3022 | 3027 | | |
3023 | 3028 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1566 | 1566 | | |
1567 | 1567 | | |
1568 | 1568 | | |
1569 | | - | |
1570 | | - | |
1571 | | - | |
1572 | | - | |
| 1569 | + | |
1573 | 1570 | | |
1574 | 1571 | | |
1575 | 1572 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
83 | 97 | | |
84 | 98 | | |
85 | 99 | | |
| |||
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
191 | 222 | | |
192 | 223 | | |
193 | 224 | | |
| |||
0 commit comments