Commit a012de1
committed
[cxx-interop] Avoid crashing when template substitution fails
This code used to crash the compiler:
var s = std.string("hi")
s.append("foo")
`append` in this case resolves to a templated C++ method that accepts `std::string_view`, while we tried passing a Swift String to it as a parameter.
rdar://107018724
(cherry picked from commit 4a1afa9)1 parent 1b9cc10 commit a012de1
File tree
5 files changed
+69
-5
lines changed- include/swift/AST
- lib/ClangImporter
- test/Interop/Cxx/templates
- Inputs
5 files changed
+69
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2056 | 2056 | | |
2057 | 2057 | | |
2058 | 2058 | | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
2059 | 2062 | | |
2060 | 2063 | | |
2061 | 2064 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5749 | 5749 | | |
5750 | 5750 | | |
5751 | 5751 | | |
5752 | | - | |
5753 | | - | |
5754 | | - | |
5755 | | - | |
5756 | 5752 | | |
| 5753 | + | |
5757 | 5754 | | |
5758 | 5755 | | |
5759 | 5756 | | |
| 5757 | + | |
| 5758 | + | |
| 5759 | + | |
| 5760 | + | |
| 5761 | + | |
| 5762 | + | |
| 5763 | + | |
5760 | 5764 | | |
5761 | 5765 | | |
5762 | 5766 | | |
5763 | 5767 | | |
5764 | 5768 | | |
5765 | | - | |
| 5769 | + | |
5766 | 5770 | | |
5767 | 5771 | | |
5768 | 5772 | | |
| |||
5772 | 5776 | | |
5773 | 5777 | | |
5774 | 5778 | | |
| 5779 | + | |
| 5780 | + | |
| 5781 | + | |
| 5782 | + | |
| 5783 | + | |
| 5784 | + | |
| 5785 | + | |
| 5786 | + | |
| 5787 | + | |
| 5788 | + | |
| 5789 | + | |
| 5790 | + | |
| 5791 | + | |
| 5792 | + | |
5775 | 5793 | | |
5776 | 5794 | | |
5777 | 5795 | | |
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
136 | 141 | | |
137 | 142 | | |
138 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
0 commit comments