Commit e094d95
committed
[clang] Implement evaluation context for checking template parameters
Instead of manually adding a note pointing to the relevant template
parameter to every relevant error, which is very easy to miss,
this patch adds a new instantiation context note, so that this
can work using RAII magic.
This fixes a bunch of places where these notes were missing, and is
more future-proof.
Some diagnostics are reworked to make better use of this note:
- Errors about missing template arguments now refer to the parameter
which is missing an argument.
- Template Template parameter mismatches now refer to template
parameters as parameters instead of arguments.
It's likely this will add the note to some diagnostics where the
parameter is not super relevant, but this can be reworked with time
and the decrease in maintenance burden makes up for it.
This bypasses the templight dumper for the new context entry, as the
tests are very hard to update.
This depends on #125453, which is needed to avoid losing the context
note for errors occuring during template argument deduction.1 parent 0948fc8 commit e094d95
File tree
95 files changed
+574
-458
lines changed- clang
- docs
- include/clang
- Basic
- Sema
- lib
- Frontend
- Sema
- test
- AST/ByteCode
- CXX
- basic/basic.lookup/basic.lookup.unqual
- dcl.decl/dcl.init/dcl.init.list
- drs
- expr
- expr.const
- expr.prim/expr.prim.req
- temp
- temp.arg
- temp.arg.nontype
- temp.arg.template
- temp.arg.type
- temp.decls
- temp.class.spec
- temp.variadic
- temp.deduct
- temp.param
- temp.res/temp.dep/temp.dep.constexpr
- temp.spec
- temp.expl.spec
- Misc
- Modules
- Parser
- SemaCXX
- SemaHLSL/BuiltIns
- SemaObjCXX
- SemaTemplate
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
95 files changed
+574
-458
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
177 | 187 | | |
178 | 188 | | |
179 | 189 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5285 | 5285 | | |
5286 | 5286 | | |
5287 | 5287 | | |
5288 | | - | |
5289 | | - | |
| 5288 | + | |
| 5289 | + | |
| 5290 | + | |
| 5291 | + | |
| 5292 | + | |
| 5293 | + | |
5290 | 5294 | | |
5291 | | - | |
| 5295 | + | |
5292 | 5296 | | |
5293 | 5297 | | |
5294 | 5298 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11782 | 11782 | | |
11783 | 11783 | | |
11784 | 11784 | | |
11785 | | - | |
| 11785 | + | |
11786 | 11786 | | |
11787 | 11787 | | |
11788 | 11788 | | |
| |||
11818 | 11818 | | |
11819 | 11819 | | |
11820 | 11820 | | |
| 11821 | + | |
| 11822 | + | |
| 11823 | + | |
| 11824 | + | |
| 11825 | + | |
11821 | 11826 | | |
11822 | 11827 | | |
11823 | | - | |
11824 | 11828 | | |
11825 | 11829 | | |
11826 | 11830 | | |
| |||
12822 | 12826 | | |
12823 | 12827 | | |
12824 | 12828 | | |
| 12829 | + | |
| 12830 | + | |
| 12831 | + | |
12825 | 12832 | | |
12826 | 12833 | | |
12827 | 12834 | | |
| |||
13049 | 13056 | | |
13050 | 13057 | | |
13051 | 13058 | | |
| 13059 | + | |
| 13060 | + | |
| 13061 | + | |
| 13062 | + | |
| 13063 | + | |
13052 | 13064 | | |
13053 | 13065 | | |
13054 | 13066 | | |
| |||
13082 | 13094 | | |
13083 | 13095 | | |
13084 | 13096 | | |
| 13097 | + | |
| 13098 | + | |
| 13099 | + | |
| 13100 | + | |
| 13101 | + | |
| 13102 | + | |
| 13103 | + | |
13085 | 13104 | | |
13086 | 13105 | | |
13087 | 13106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
406 | | - | |
| 406 | + | |
| 407 | + | |
407 | 408 | | |
408 | 409 | | |
409 | 410 | | |
| |||
461 | 462 | | |
462 | 463 | | |
463 | 464 | | |
| 465 | + | |
| 466 | + | |
464 | 467 | | |
465 | | - | |
| 468 | + | |
466 | 469 | | |
467 | 470 | | |
468 | 471 | | |
469 | 472 | | |
470 | 473 | | |
471 | 474 | | |
472 | 475 | | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
473 | 480 | | |
474 | 481 | | |
475 | | - | |
476 | | - | |
477 | 482 | | |
478 | | - | |
| 483 | + | |
479 | 484 | | |
480 | 485 | | |
481 | 486 | | |
| |||
555 | 560 | | |
556 | 561 | | |
557 | 562 | | |
558 | | - | |
559 | | - | |
| 563 | + | |
| 564 | + | |
560 | 565 | | |
561 | | - | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
562 | 570 | | |
563 | 571 | | |
564 | 572 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7268 | 7268 | | |
7269 | 7269 | | |
7270 | 7270 | | |
7271 | | - | |
| 7271 | + | |
7272 | 7272 | | |
7273 | 7273 | | |
7274 | 7274 | | |
| |||
7277 | 7277 | | |
7278 | 7278 | | |
7279 | 7279 | | |
7280 | | - | |
7281 | | - | |
7282 | | - | |
| 7280 | + | |
| 7281 | + | |
7283 | 7282 | | |
7284 | 7283 | | |
7285 | 7284 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1506 | 1506 | | |
1507 | 1507 | | |
1508 | 1508 | | |
1509 | | - | |
| 1509 | + | |
1510 | 1510 | | |
1511 | 1511 | | |
| 1512 | + | |
1512 | 1513 | | |
1513 | | - | |
| 1514 | + | |
1514 | 1515 | | |
1515 | | - | |
1516 | | - | |
1517 | 1516 | | |
1518 | 1517 | | |
1519 | 1518 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1586 | 1586 | | |
1587 | 1587 | | |
1588 | 1588 | | |
1589 | | - | |
1590 | | - | |
1591 | | - | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
1592 | 1596 | | |
1593 | 1597 | | |
1594 | 1598 | | |
| |||
3709 | 3713 | | |
3710 | 3714 | | |
3711 | 3715 | | |
3712 | | - | |
| 3716 | + | |
| 3717 | + | |
3713 | 3718 | | |
3714 | 3719 | | |
3715 | 3720 | | |
| |||
3722 | 3727 | | |
3723 | 3728 | | |
3724 | 3729 | | |
| 3730 | + | |
3725 | 3731 | | |
3726 | 3732 | | |
3727 | 3733 | | |
| |||
0 commit comments