Commit c87bc75
authored
[BoundsSafety] Delay processing of bounds attrs in templates (#9929)
* [BoundsSafety] Delay processing of bounds attrs in templates
Dynamic bounds attributes do not handle value dependent arguments. To
enable wider interop with C++ code bases we delay the processing of
these attributes inside templated contexts. Instead we apply the new
type while instantiating the function.
One issue with this approach is that instantiation happens after parsing
is finished, and the Scope information we use to prevent attributes from
referring to arguments from outer scopes is only available during
parsing. These diagnostics were emitted at the end of the type
processing. In templated contexts we instead perform that analysis
during parsing, and delay the rest of the processing. To avoid churn in
unrelated tests the rest of the attributes keep their processing as is,
until we've investigated what impact hoisting it would have on the user
experience.1 parent 48f0651 commit c87bc75
File tree
11 files changed
+976
-71
lines changed- clang
- include/clang/Sema
- lib/Sema
- test
- BoundsSafety
- AST
- Sema
- SemaCXX
11 files changed
+976
-71
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15509 | 15509 | | |
15510 | 15510 | | |
15511 | 15511 | | |
15512 | | - | |
| 15512 | + | |
| 15513 | + | |
15513 | 15514 | | |
15514 | 15515 | | |
15515 | 15516 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1594 | 1594 | | |
1595 | 1595 | | |
1596 | 1596 | | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
1597 | 1601 | | |
1598 | 1602 | | |
1599 | 1603 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3484 | 3484 | | |
3485 | 3485 | | |
3486 | 3486 | | |
| 3487 | + | |
| 3488 | + | |
| 3489 | + | |
3487 | 3490 | | |
3488 | 3491 | | |
3489 | 3492 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17302 | 17302 | | |
17303 | 17303 | | |
17304 | 17304 | | |
| 17305 | + | |
| 17306 | + | |
| 17307 | + | |
| 17308 | + | |
| 17309 | + | |
17305 | 17310 | | |
17306 | 17311 | | |
17307 | 17312 | | |
| |||
17325 | 17330 | | |
17326 | 17331 | | |
17327 | 17332 | | |
17328 | | - | |
17329 | | - | |
17330 | | - | |
17331 | | - | |
17332 | | - | |
17333 | 17333 | | |
17334 | 17334 | | |
17335 | 17335 | | |
| |||
0 commit comments