Commit e57a9ab
committed
[Concepts] Placeholder constraints and abbreviated templates
This patch implements P1141R2 "Yet another approach for constrained declarations".
General strategy for this patch was:
- Expand AutoType to include optional type-constraint, reflecting the wording and easing the integration of constraints.
- Replace autos in parameter type specifiers with invented parameters in GetTypeSpecTypeForDeclarator, using the same logic
previously used for generic lambdas, now unified with abbreviated templates, by:
- Tracking the template parameter lists in the Declarator object
- Tracking the template parameter depth before parsing function declarators (at which point we can match template
parameters against scope specifiers to know if we have an explicit template parameter list to append invented parameters
to or not).
- When encountering an AutoType in a parameter context we check a stack of InventedTemplateParameterInfo structures that
contain the info required to create and accumulate invented template parameters (fields that were already present in
LambdaScopeInfo, which now inherits from this class and is looked up when an auto is encountered in a lambda context).
Resubmit after incorrect check in NonTypeTemplateParmDecl broke lldb.
Differential Revision: https://reviews.llvm.org/D650421 parent 0957233 commit e57a9ab
File tree
53 files changed
+1869
-362
lines changed- clang
- include/clang
- AST
- Basic
- Sema
- lib
- AST
- Parse
- Sema
- Serialization
- test
- AST
- CXX
- dcl
- dcl.fct
- dcl.spec/dcl.type/dcl.spec.auto
- expr/expr.prim/expr.prim.lambda/expr.prim.lambda.closure
- temp/temp.param
- Parser
- SemaCXX
- SemaTemplate
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
53 files changed
+1869
-362
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| |||
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
214 | | - | |
| 215 | + | |
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
| |||
1542 | 1543 | | |
1543 | 1544 | | |
1544 | 1545 | | |
1545 | | - | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
1546 | 1549 | | |
1547 | 1550 | | |
1548 | 1551 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
551 | | - | |
552 | | - | |
| 551 | + | |
| 552 | + | |
553 | 553 | | |
554 | 554 | | |
555 | 555 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1102 | 1102 | | |
1103 | 1103 | | |
1104 | 1104 | | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
1105 | 1116 | | |
1106 | 1117 | | |
1107 | 1118 | | |
| |||
1215 | 1226 | | |
1216 | 1227 | | |
1217 | 1228 | | |
1218 | | - | |
1219 | 1229 | | |
1220 | 1230 | | |
1221 | 1231 | | |
| |||
1374 | 1384 | | |
1375 | 1385 | | |
1376 | 1386 | | |
1377 | | - | |
| 1387 | + | |
| 1388 | + | |
1378 | 1389 | | |
1379 | 1390 | | |
1380 | 1391 | | |
| |||
1429 | 1440 | | |
1430 | 1441 | | |
1431 | 1442 | | |
1432 | | - | |
| 1443 | + | |
| 1444 | + | |
1433 | 1445 | | |
1434 | 1446 | | |
1435 | | - | |
| 1447 | + | |
| 1448 | + | |
1436 | 1449 | | |
1437 | 1450 | | |
1438 | 1451 | | |
| |||
1543 | 1556 | | |
1544 | 1557 | | |
1545 | 1558 | | |
1546 | | - | |
| 1559 | + | |
1547 | 1560 | | |
1548 | | - | |
1549 | | - | |
1550 | | - | |
1551 | | - | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
1552 | 1568 | | |
1553 | 1569 | | |
1554 | 1570 | | |
1555 | 1571 | | |
1556 | 1572 | | |
1557 | | - | |
1558 | | - | |
1559 | | - | |
| 1573 | + | |
| 1574 | + | |
1560 | 1575 | | |
1561 | 1576 | | |
1562 | 1577 | | |
| |||
1566 | 1581 | | |
1567 | 1582 | | |
1568 | 1583 | | |
1569 | | - | |
1570 | | - | |
| 1584 | + | |
| 1585 | + | |
1571 | 1586 | | |
1572 | 1587 | | |
1573 | 1588 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1040 | 1040 | | |
1041 | 1041 | | |
1042 | 1042 | | |
1043 | | - | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
1044 | 1050 | | |
1045 | 1051 | | |
1046 | 1052 | | |
| |||
1287 | 1293 | | |
1288 | 1294 | | |
1289 | 1295 | | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
1290 | 1302 | | |
1291 | 1303 | | |
1292 | 1304 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
637 | 637 | | |
638 | 638 | | |
639 | 639 | | |
640 | | - | |
| 640 | + | |
641 | 641 | | |
642 | 642 | | |
643 | 643 | | |
| |||
702 | 702 | | |
703 | 703 | | |
704 | 704 | | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
705 | 710 | | |
706 | 711 | | |
707 | 712 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| |||
1683 | 1684 | | |
1684 | 1685 | | |
1685 | 1686 | | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
1686 | 1696 | | |
1687 | 1697 | | |
1688 | 1698 | | |
| |||
4814 | 4824 | | |
4815 | 4825 | | |
4816 | 4826 | | |
4817 | | - | |
4818 | | - | |
| 4827 | + | |
4819 | 4828 | | |
4820 | 4829 | | |
4821 | 4830 | | |
| |||
4860 | 4869 | | |
4861 | 4870 | | |
4862 | 4871 | | |
4863 | | - | |
4864 | | - | |
| 4872 | + | |
| 4873 | + | |
| 4874 | + | |
4865 | 4875 | | |
4866 | 4876 | | |
| 4877 | + | |
| 4878 | + | |
4867 | 4879 | | |
4868 | | - | |
4869 | | - | |
4870 | | - | |
4871 | | - | |
| 4880 | + | |
| 4881 | + | |
| 4882 | + | |
| 4883 | + | |
| 4884 | + | |
| 4885 | + | |
| 4886 | + | |
| 4887 | + | |
| 4888 | + | |
4872 | 4889 | | |
4873 | 4890 | | |
4874 | 4891 | | |
| 4892 | + | |
| 4893 | + | |
| 4894 | + | |
| 4895 | + | |
| 4896 | + | |
| 4897 | + | |
| 4898 | + | |
| 4899 | + | |
| 4900 | + | |
| 4901 | + | |
| 4902 | + | |
| 4903 | + | |
| 4904 | + | |
| 4905 | + | |
| 4906 | + | |
| 4907 | + | |
| 4908 | + | |
| 4909 | + | |
| 4910 | + | |
| 4911 | + | |
| 4912 | + | |
| 4913 | + | |
| 4914 | + | |
| 4915 | + | |
4875 | 4916 | | |
4876 | 4917 | | |
4877 | 4918 | | |
| |||
4880 | 4921 | | |
4881 | 4922 | | |
4882 | 4923 | | |
4883 | | - | |
4884 | | - | |
4885 | | - | |
| 4924 | + | |
| 4925 | + | |
| 4926 | + | |
4886 | 4927 | | |
4887 | 4928 | | |
4888 | | - | |
4889 | | - | |
4890 | | - | |
4891 | | - | |
4892 | | - | |
4893 | | - | |
4894 | | - | |
| 4929 | + | |
| 4930 | + | |
| 4931 | + | |
| 4932 | + | |
4895 | 4933 | | |
4896 | 4934 | | |
4897 | 4935 | | |
| |||
0 commit comments