Commit 0017e08
committed
[Clang] Remove the wrong assumption when rebuilding SizeOfPackExprs for constraint normalization
In 463a4f1, we assumed that all the template argument packs are
of size 1 when normalizing a constraint expression because I mistakenly
thought those packs were obtained from their injected template parameters.
This was wrong because we might be checking constraints when instantiating
a friend declaration within a class template specialization, where the
parent class template is specialized with non-dependent template arguments.
In that sense, we shouldn't assume any pack size nor expand anything in
such a scenario. Moreover, there are no intermediate (substituted but unexpanded)
AST nodes for template template parameters, so we have to special-case their
transformations by looking into the instantiation scope instead of extracting
anything from template arguments.1 parent 88823d0 commit 0017e08
File tree
2 files changed
+35
-17
lines changed- clang
- lib/Sema
- test/SemaTemplate
2 files changed
+35
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1736 | 1736 | | |
1737 | 1737 | | |
1738 | 1738 | | |
1739 | | - | |
1740 | | - | |
1741 | | - | |
1742 | | - | |
1743 | | - | |
1744 | | - | |
1745 | | - | |
1746 | | - | |
1747 | | - | |
1748 | | - | |
1749 | | - | |
1750 | | - | |
1751 | | - | |
1752 | | - | |
1753 | | - | |
1754 | | - | |
1755 | | - | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
1756 | 1746 | | |
1757 | 1747 | | |
1758 | 1748 | | |
| |||
1881 | 1871 | | |
1882 | 1872 | | |
1883 | 1873 | | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
1884 | 1883 | | |
1885 | 1884 | | |
1886 | 1885 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
702 | 702 | | |
703 | 703 | | |
704 | 704 | | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
0 commit comments