Commit a520014
[Clang] Recompute the value category when rebuilding SubstNonTypeTemplateParmExpr (llvm#172251)
In concept checking, we need to transform SubstNTTPExpr when evaluating
constraints.
The value category is initially computed during parameter mapping,
possibly with a dependent expression. However during instantiation, it
wasn't recomputed, and the stale category is propagated into parent
expressions. So we may end up with an 'out-of-thin-air' reference type,
which breaks the evaluation.
We now call BuildSubstNonTypeTemplateParmExpr in TreeTransform, in which
the value category is recomputed.
The issue was brought by both 078e99e and the concept normalization
patch, which are not released yet, so no release note.
Fixes llvm#1708561 parent a570eac commit a520014
2 files changed
+59
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4297 | 4297 | | |
4298 | 4298 | | |
4299 | 4299 | | |
| 4300 | + | |
| 4301 | + | |
| 4302 | + | |
| 4303 | + | |
| 4304 | + | |
| 4305 | + | |
| 4306 | + | |
| 4307 | + | |
| 4308 | + | |
4300 | 4309 | | |
4301 | 4310 | | |
4302 | 4311 | | |
| |||
16467 | 16476 | | |
16468 | 16477 | | |
16469 | 16478 | | |
16470 | | - | |
| 16479 | + | |
16471 | 16480 | | |
16472 | 16481 | | |
16473 | 16482 | | |
| |||
16525 | 16534 | | |
16526 | 16535 | | |
16527 | 16536 | | |
16528 | | - | |
16529 | | - | |
16530 | | - | |
16531 | | - | |
| 16537 | + | |
| 16538 | + | |
| 16539 | + | |
| 16540 | + | |
16532 | 16541 | | |
16533 | 16542 | | |
16534 | 16543 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1658 | 1658 | | |
1659 | 1659 | | |
1660 | 1660 | | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
0 commit comments