Commit 6d7962d
authored
[clang][CUDA] Avoid ambiguity in host/device template specializations (#201049)
This commit changes SemaOverload to resolve an otherwise diagnosed
ambiguity between addresses of template specializations of functions
that are overloaded for both device and host. Similar to how it works
for non-templated function overloads, these changes prioritizes the
specializations that corresponds to the target of the owning function,
i.e. if compiling for host, the address of the host specialization takes
precedence over the device specialization and vice versa.
Fixes #199299
---------
Signed-off-by: Steffen Holst Larsen <[email protected]>1 parent ee20b10 commit 6d7962d
4 files changed
Lines changed: 37 additions & 3 deletions
File tree
- clang
- docs
- lib/Sema
- test/SemaCUDA
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
822 | 822 | | |
823 | 823 | | |
824 | 824 | | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
825 | 829 | | |
826 | 830 | | |
827 | 831 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13742 | 13742 | | |
13743 | 13743 | | |
13744 | 13744 | | |
| 13745 | + | |
| 13746 | + | |
| 13747 | + | |
13745 | 13748 | | |
13746 | 13749 | | |
13747 | 13750 | | |
| |||
13752 | 13755 | | |
13753 | 13756 | | |
13754 | 13757 | | |
13755 | | - | |
13756 | | - | |
13757 | | - | |
13758 | 13758 | | |
13759 | 13759 | | |
13760 | 13760 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
| 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 | + | |
0 commit comments