Commit 59ec190
committed
Reland: [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.
Original PR: #1260881 parent 13649cf commit 59ec190
File tree
105 files changed
+636
-542
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
- Sema
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
105 files changed
+636
-542
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
436 | 446 | | |
437 | 447 | | |
438 | 448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5358 | 5358 | | |
5359 | 5359 | | |
5360 | 5360 | | |
5361 | | - | |
5362 | | - | |
5363 | | - | |
5364 | | - | |
5365 | | - | |
5366 | | - | |
| 5361 | + | |
| 5362 | + | |
| 5363 | + | |
5367 | 5364 | | |
5368 | 5365 | | |
5369 | | - | |
5370 | | - | |
5371 | | - | |
5372 | | - | |
5373 | | - | |
| 5366 | + | |
| 5367 | + | |
| 5368 | + | |
5374 | 5369 | | |
5375 | 5370 | | |
5376 | 5371 | | |
| |||
5379 | 5374 | | |
5380 | 5375 | | |
5381 | 5376 | | |
5382 | | - | |
5383 | | - | |
5384 | 5377 | | |
5385 | 5378 | | |
5386 | 5379 | | |
| |||
5454 | 5447 | | |
5455 | 5448 | | |
5456 | 5449 | | |
5457 | | - | |
5458 | | - | |
5459 | | - | |
5460 | | - | |
| 5450 | + | |
| 5451 | + | |
| 5452 | + | |
| 5453 | + | |
| 5454 | + | |
| 5455 | + | |
| 5456 | + | |
| 5457 | + | |
| 5458 | + | |
| 5459 | + | |
| 5460 | + | |
5461 | 5461 | | |
5462 | 5462 | | |
5463 | 5463 | | |
| |||
5500 | 5500 | | |
5501 | 5501 | | |
5502 | 5502 | | |
5503 | | - | |
5504 | | - | |
5505 | | - | |
5506 | | - | |
5507 | | - | |
5508 | | - | |
| 5503 | + | |
| 5504 | + | |
| 5505 | + | |
5509 | 5506 | | |
5510 | 5507 | | |
5511 | 5508 | | |
| |||
6050 | 6047 | | |
6051 | 6048 | | |
6052 | 6049 | | |
6053 | | - | |
6054 | | - | |
6055 | | - | |
6056 | | - | |
6057 | | - | |
6058 | | - | |
6059 | | - | |
6060 | | - | |
| 6050 | + | |
| 6051 | + | |
| 6052 | + | |
| 6053 | + | |
| 6054 | + | |
6061 | 6055 | | |
6062 | 6056 | | |
6063 | 6057 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12026 | 12026 | | |
12027 | 12027 | | |
12028 | 12028 | | |
12029 | | - | |
| 12029 | + | |
12030 | 12030 | | |
12031 | 12031 | | |
12032 | 12032 | | |
| |||
12066 | 12066 | | |
12067 | 12067 | | |
12068 | 12068 | | |
| 12069 | + | |
| 12070 | + | |
| 12071 | + | |
| 12072 | + | |
| 12073 | + | |
12069 | 12074 | | |
12070 | 12075 | | |
12071 | | - | |
12072 | 12076 | | |
12073 | 12077 | | |
12074 | 12078 | | |
| |||
12183 | 12187 | | |
12184 | 12188 | | |
12185 | 12189 | | |
12186 | | - | |
12187 | | - | |
| 12190 | + | |
12188 | 12191 | | |
12189 | | - | |
12190 | | - | |
12191 | | - | |
12192 | | - | |
| 12192 | + | |
| 12193 | + | |
| 12194 | + | |
12193 | 12195 | | |
12194 | | - | |
| 12196 | + | |
12195 | 12197 | | |
12196 | 12198 | | |
12197 | 12199 | | |
| |||
13088 | 13090 | | |
13089 | 13091 | | |
13090 | 13092 | | |
| 13093 | + | |
| 13094 | + | |
| 13095 | + | |
| 13096 | + | |
| 13097 | + | |
13091 | 13098 | | |
13092 | 13099 | | |
13093 | 13100 | | |
| |||
13318 | 13325 | | |
13319 | 13326 | | |
13320 | 13327 | | |
| 13328 | + | |
| 13329 | + | |
| 13330 | + | |
| 13331 | + | |
| 13332 | + | |
13321 | 13333 | | |
13322 | 13334 | | |
13323 | 13335 | | |
| |||
13351 | 13363 | | |
13352 | 13364 | | |
13353 | 13365 | | |
| 13366 | + | |
| 13367 | + | |
| 13368 | + | |
| 13369 | + | |
| 13370 | + | |
| 13371 | + | |
| 13372 | + | |
13354 | 13373 | | |
13355 | 13374 | | |
13356 | 13375 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
421 | | - | |
| 421 | + | |
| 422 | + | |
422 | 423 | | |
423 | 424 | | |
424 | 425 | | |
| |||
476 | 477 | | |
477 | 478 | | |
478 | 479 | | |
| 480 | + | |
| 481 | + | |
479 | 482 | | |
480 | | - | |
| 483 | + | |
481 | 484 | | |
482 | 485 | | |
483 | 486 | | |
484 | 487 | | |
485 | 488 | | |
486 | 489 | | |
487 | 490 | | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
488 | 495 | | |
489 | 496 | | |
490 | | - | |
491 | | - | |
492 | 497 | | |
493 | | - | |
| 498 | + | |
494 | 499 | | |
495 | 500 | | |
496 | 501 | | |
| |||
570 | 575 | | |
571 | 576 | | |
572 | 577 | | |
573 | | - | |
574 | | - | |
| 578 | + | |
| 579 | + | |
575 | 580 | | |
576 | | - | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
577 | 585 | | |
578 | 586 | | |
579 | 587 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7342 | 7342 | | |
7343 | 7343 | | |
7344 | 7344 | | |
7345 | | - | |
| 7345 | + | |
7346 | 7346 | | |
7347 | 7347 | | |
7348 | 7348 | | |
| |||
7351 | 7351 | | |
7352 | 7352 | | |
7353 | 7353 | | |
7354 | | - | |
7355 | | - | |
7356 | | - | |
| 7354 | + | |
| 7355 | + | |
7357 | 7356 | | |
7358 | 7357 | | |
7359 | 7358 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1525 | 1525 | | |
1526 | 1526 | | |
1527 | 1527 | | |
1528 | | - | |
| 1528 | + | |
1529 | 1529 | | |
1530 | 1530 | | |
| 1531 | + | |
1531 | 1532 | | |
1532 | | - | |
| 1533 | + | |
1533 | 1534 | | |
1534 | | - | |
1535 | | - | |
1536 | 1535 | | |
1537 | 1536 | | |
1538 | 1537 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1613 | 1613 | | |
1614 | 1614 | | |
1615 | 1615 | | |
1616 | | - | |
1617 | | - | |
1618 | | - | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
1619 | 1623 | | |
1620 | 1624 | | |
1621 | 1625 | | |
| |||
3738 | 3742 | | |
3739 | 3743 | | |
3740 | 3744 | | |
3741 | | - | |
| 3745 | + | |
| 3746 | + | |
3742 | 3747 | | |
3743 | 3748 | | |
3744 | 3749 | | |
| |||
3751 | 3756 | | |
3752 | 3757 | | |
3753 | 3758 | | |
| 3759 | + | |
3754 | 3760 | | |
3755 | 3761 | | |
3756 | 3762 | | |
| |||
0 commit comments