Commit 4fb33c6
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 llvm#125453, which is needed to avoid losing the context
note for errors occuring during template argument deduction.
Original PR: llvm#1260881 parent fd073a3 commit 4fb33c6
File tree
101 files changed
+642
-528
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.
101 files changed
+642
-528
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | | - | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
350 | 354 | | |
351 | 355 | | |
352 | 356 | | |
| |||
| 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 | | |
| |||
6052 | 6049 | | |
6053 | 6050 | | |
6054 | 6051 | | |
6055 | | - | |
6056 | | - | |
6057 | | - | |
6058 | | - | |
6059 | | - | |
6060 | | - | |
6061 | | - | |
6062 | | - | |
| 6052 | + | |
| 6053 | + | |
| 6054 | + | |
| 6055 | + | |
| 6056 | + | |
6063 | 6057 | | |
6064 | 6058 | | |
6065 | 6059 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12047 | 12047 | | |
12048 | 12048 | | |
12049 | 12049 | | |
12050 | | - | |
| 12050 | + | |
12051 | 12051 | | |
12052 | 12052 | | |
12053 | 12053 | | |
| |||
12087 | 12087 | | |
12088 | 12088 | | |
12089 | 12089 | | |
| 12090 | + | |
| 12091 | + | |
| 12092 | + | |
| 12093 | + | |
| 12094 | + | |
12090 | 12095 | | |
12091 | 12096 | | |
12092 | | - | |
12093 | 12097 | | |
12094 | 12098 | | |
12095 | 12099 | | |
| |||
12204 | 12208 | | |
12205 | 12209 | | |
12206 | 12210 | | |
12207 | | - | |
12208 | | - | |
| 12211 | + | |
12209 | 12212 | | |
12210 | | - | |
12211 | | - | |
12212 | | - | |
12213 | | - | |
| 12213 | + | |
| 12214 | + | |
| 12215 | + | |
12214 | 12216 | | |
12215 | | - | |
| 12217 | + | |
12216 | 12218 | | |
12217 | 12219 | | |
12218 | 12220 | | |
| |||
13155 | 13157 | | |
13156 | 13158 | | |
13157 | 13159 | | |
| 13160 | + | |
| 13161 | + | |
| 13162 | + | |
| 13163 | + | |
| 13164 | + | |
13158 | 13165 | | |
13159 | 13166 | | |
13160 | 13167 | | |
| |||
13390 | 13397 | | |
13391 | 13398 | | |
13392 | 13399 | | |
| 13400 | + | |
| 13401 | + | |
| 13402 | + | |
| 13403 | + | |
13393 | 13404 | | |
13394 | 13405 | | |
13395 | 13406 | | |
| |||
13416 | 13427 | | |
13417 | 13428 | | |
13418 | 13429 | | |
| 13430 | + | |
| 13431 | + | |
| 13432 | + | |
| 13433 | + | |
| 13434 | + | |
| 13435 | + | |
| 13436 | + | |
| 13437 | + | |
| 13438 | + | |
| 13439 | + | |
| 13440 | + | |
| 13441 | + | |
| 13442 | + | |
| 13443 | + | |
| 13444 | + | |
| 13445 | + | |
| 13446 | + | |
| 13447 | + | |
| 13448 | + | |
| 13449 | + | |
| 13450 | + | |
| 13451 | + | |
| 13452 | + | |
| 13453 | + | |
13419 | 13454 | | |
13420 | 13455 | | |
13421 | 13456 | | |
| |||
| 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 | |
|---|---|---|---|
| |||
7330 | 7330 | | |
7331 | 7331 | | |
7332 | 7332 | | |
7333 | | - | |
| 7333 | + | |
7334 | 7334 | | |
7335 | 7335 | | |
7336 | 7336 | | |
| |||
7339 | 7339 | | |
7340 | 7340 | | |
7341 | 7341 | | |
7342 | | - | |
7343 | | - | |
7344 | | - | |
| 7342 | + | |
| 7343 | + | |
7345 | 7344 | | |
7346 | 7345 | | |
7347 | 7346 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1525 | 1525 | | |
1526 | 1526 | | |
1527 | 1527 | | |
1528 | | - | |
| 1528 | + | |
| 1529 | + | |
1529 | 1530 | | |
1530 | 1531 | | |
| 1532 | + | |
1531 | 1533 | | |
1532 | 1534 | | |
1533 | 1535 | | |
1534 | | - | |
| 1536 | + | |
| 1537 | + | |
1535 | 1538 | | |
1536 | 1539 | | |
1537 | 1540 | | |
| |||
| 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 | | |
| |||
3735 | 3739 | | |
3736 | 3740 | | |
3737 | 3741 | | |
3738 | | - | |
| 3742 | + | |
| 3743 | + | |
3739 | 3744 | | |
3740 | 3745 | | |
3741 | 3746 | | |
| |||
3748 | 3753 | | |
3749 | 3754 | | |
3750 | 3755 | | |
| 3756 | + | |
3751 | 3757 | | |
3752 | 3758 | | |
3753 | 3759 | | |
| |||
0 commit comments