Commit e621da3
committed
[clang] Template Specialization Resugaring - TypeDecl
This is the introductory patch for a larger work which intends to solve the long standing C++ issue with losing type sugar when acessing template specializations. The well known example here is specializing a template with `std::string`, but getting diagnostics related to `std::basic_string<char>` instead. This implements a transform which, upon member access, propagates type sugar from the naming context into the accessed entity. It also implements a single use of this transform, resugaring access to TypeDecls. For more details and discussion see: https://discourse.llvm.org/t/rfc-improving-diagnostics-with-template-specialization-resugaring/64294 This is ready for review, although maybe not finished and there is some more stuff that could be done either here or in follow ups. * Its worth exploring if a global resugaring cache is worthwhile, besides the current operational cache. A global cache would be more expensive to index, so there is a tradeoff, and maybe should be used of the whole result of the operation, while keeping the existing cache for sub-results. * It would be ideal if the transform could live in ASTContext instead of Sema. There are a few dependencies that would have to be tackled. * Template arguments deduced for partial specializations. * Some kinds of type adjustments currently require Sema. Differential Revision: https://reviews.llvm.org/D1276951 parent 6f70503 commit e621da3
File tree
17 files changed
+985
-51
lines changed- clang-tools-extra/clang-tidy/readability
- clang
- include/clang
- AST
- Sema
- lib
- AST
- Sema
- test
- AST
- CXX/temp/temp.param
- Sema/Resugar
- lldb/test/API/commands/expression/import-std-module/iterator
17 files changed
+985
-51
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1319 | 1319 | | |
1320 | 1320 | | |
1321 | 1321 | | |
1322 | | - | |
1323 | | - | |
1324 | 1322 | | |
1325 | 1323 | | |
1326 | 1324 | | |
| |||
1500 | 1498 | | |
1501 | 1499 | | |
1502 | 1500 | | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
1503 | 1504 | | |
1504 | 1505 | | |
1505 | 1506 | | |
| |||
1901 | 1902 | | |
1902 | 1903 | | |
1903 | 1904 | | |
1904 | | - | |
1905 | | - | |
1906 | | - | |
1907 | | - | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
1908 | 1909 | | |
1909 | 1910 | | |
1910 | 1911 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
643 | 643 | | |
644 | 644 | | |
645 | 645 | | |
646 | | - | |
| 646 | + | |
647 | 647 | | |
648 | 648 | | |
649 | | - | |
| 649 | + | |
650 | 650 | | |
651 | 651 | | |
652 | 652 | | |
| |||
662 | 662 | | |
663 | 663 | | |
664 | 664 | | |
665 | | - | |
| 665 | + | |
666 | 666 | | |
667 | 667 | | |
668 | | - | |
| 668 | + | |
669 | 669 | | |
670 | 670 | | |
671 | 671 | | |
| |||
805 | 805 | | |
806 | 806 | | |
807 | 807 | | |
| 808 | + | |
808 | 809 | | |
809 | 810 | | |
810 | 811 | | |
811 | 812 | | |
812 | 813 | | |
813 | | - | |
| 814 | + | |
814 | 815 | | |
815 | 816 | | |
816 | 817 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3193 | 3193 | | |
3194 | 3194 | | |
3195 | 3195 | | |
3196 | | - | |
| 3196 | + | |
| 3197 | + | |
3197 | 3198 | | |
3198 | 3199 | | |
3199 | 3200 | | |
| |||
13980 | 13981 | | |
13981 | 13982 | | |
13982 | 13983 | | |
| 13984 | + | |
| 13985 | + | |
13983 | 13986 | | |
13984 | 13987 | | |
13985 | 13988 | | |
| |||
14972 | 14975 | | |
14973 | 14976 | | |
14974 | 14977 | | |
14975 | | - | |
| 14978 | + | |
| 14979 | + | |
14976 | 14980 | | |
14977 | 14981 | | |
14978 | 14982 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6385 | 6385 | | |
6386 | 6386 | | |
6387 | 6387 | | |
6388 | | - | |
6389 | | - | |
6390 | | - | |
6391 | | - | |
| 6388 | + | |
| 6389 | + | |
| 6390 | + | |
| 6391 | + | |
| 6392 | + | |
6392 | 6393 | | |
6393 | | - | |
6394 | | - | |
| 6394 | + | |
| 6395 | + | |
6395 | 6396 | | |
6396 | 6397 | | |
6397 | 6398 | | |
| |||
14103 | 14104 | | |
14104 | 14105 | | |
14105 | 14106 | | |
14106 | | - | |
14107 | | - | |
14108 | | - | |
| 14107 | + | |
14109 | 14108 | | |
14110 | 14109 | | |
14111 | 14110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
644 | 644 | | |
645 | 645 | | |
646 | 646 | | |
647 | | - | |
648 | | - | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
649 | 650 | | |
650 | 651 | | |
651 | 652 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
| 143 | + | |
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
| |||
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
159 | | - | |
| 160 | + | |
160 | 161 | | |
161 | 162 | | |
162 | 163 | | |
| |||
534 | 535 | | |
535 | 536 | | |
536 | 537 | | |
537 | | - | |
| 538 | + | |
538 | 539 | | |
539 | 540 | | |
540 | 541 | | |
| |||
9872 | 9873 | | |
9873 | 9874 | | |
9874 | 9875 | | |
9875 | | - | |
| 9876 | + | |
9876 | 9877 | | |
9877 | 9878 | | |
9878 | 9879 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1248 | 1248 | | |
1249 | 1249 | | |
1250 | 1250 | | |
1251 | | - | |
| 1251 | + | |
1252 | 1252 | | |
1253 | 1253 | | |
1254 | 1254 | | |
| |||
0 commit comments