Commit 88c1779
authored
Propagate ParameterModifiers in templates (#4089)
This addresses two issues that blocked template instantiation of
functions with ParameterModifiers.
The first issue is that template deduction was not propagating
ParameterModifiers, but since the modifiers do influence overload
resolution, matches were never being found.
The second issue is that template instantiation was not propagating
ParameterModifiers, so even if dedution managed to succeed, it would
produce an instantiaton that wouldn't match.
The silly issue that still remains after this is that our
ParameterModifiers sholud be attached to the QualType for the
parameters. We already bake in the effect of the ParameterModifier to
the QualType, so we were getting overload mismatches on identical
functions. If we move the ParameterModifiers to the QualTypes similar
to other type qualifiers, we can actually get rid of this patch.
This resolves #40841 parent 552b11b commit 88c1779
5 files changed
Lines changed: 98 additions & 18 deletions
File tree
- tools/clang
- include/clang/Sema
- lib/Sema
- test/HLSLFileCheck/hlsl/template
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1254 | 1254 | | |
1255 | 1255 | | |
1256 | 1256 | | |
1257 | | - | |
1258 | | - | |
| 1257 | + | |
| 1258 | + | |
1259 | 1259 | | |
1260 | | - | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
1261 | 1263 | | |
1262 | 1264 | | |
1263 | 1265 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2605 | 2605 | | |
2606 | 2606 | | |
2607 | 2607 | | |
2608 | | - | |
2609 | | - | |
2610 | | - | |
2611 | | - | |
| 2608 | + | |
| 2609 | + | |
| 2610 | + | |
| 2611 | + | |
| 2612 | + | |
| 2613 | + | |
2612 | 2614 | | |
2613 | 2615 | | |
2614 | 2616 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2240 | 2240 | | |
2241 | 2241 | | |
2242 | 2242 | | |
| 2243 | + | |
2243 | 2244 | | |
2244 | 2245 | | |
2245 | 2246 | | |
2246 | | - | |
| 2247 | + | |
| 2248 | + | |
| 2249 | + | |
2247 | 2250 | | |
2248 | 2251 | | |
2249 | 2252 | | |
| |||
2267 | 2270 | | |
2268 | 2271 | | |
2269 | 2272 | | |
2270 | | - | |
2271 | | - | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
2272 | 2276 | | |
2273 | 2277 | | |
2274 | 2278 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
793 | 793 | | |
794 | 794 | | |
795 | 795 | | |
796 | | - | |
797 | | - | |
798 | | - | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
799 | 802 | | |
800 | 803 | | |
801 | 804 | | |
| |||
4745 | 4748 | | |
4746 | 4749 | | |
4747 | 4750 | | |
4748 | | - | |
| 4751 | + | |
| 4752 | + | |
| 4753 | + | |
| 4754 | + | |
4749 | 4755 | | |
4750 | 4756 | | |
4751 | 4757 | | |
| |||
10631 | 10637 | | |
10632 | 10638 | | |
10633 | 10639 | | |
10634 | | - | |
10635 | | - | |
10636 | | - | |
| 10640 | + | |
| 10641 | + | |
| 10642 | + | |
| 10643 | + | |
| 10644 | + | |
10637 | 10645 | | |
10638 | 10646 | | |
10639 | 10647 | | |
| |||
10873 | 10881 | | |
10874 | 10882 | | |
10875 | 10883 | | |
| 10884 | + | |
10876 | 10885 | | |
10877 | 10886 | | |
10878 | 10887 | | |
10879 | 10888 | | |
| 10889 | + | |
10880 | 10890 | | |
10881 | 10891 | | |
10882 | 10892 | | |
10883 | 10893 | | |
10884 | | - | |
| 10894 | + | |
10885 | 10895 | | |
| 10896 | + | |
10886 | 10897 | | |
10887 | 10898 | | |
10888 | 10899 | | |
| |||
Lines changed: 61 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
0 commit comments