<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - libcxx's string_view breaks C++11 code (r276238)"
href="https://llvm.org/bugs/show_bug.cgi?id=28772">28772</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>libcxx's string_view breaks C++11 code (r276238)
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>vsk@apple.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>The following code breaks when compiled with ToT clang+libcxx using -std=c++11:
```
#include <string>
int main() {
std::string A = "Hello";
const char *B = "world";
A.assign(B, 0, 1);
return 0;
}
```
There is an ambiguous implicit conversion:
```
A.assign(B, 0, 1);
~~^~~~~~
/Users/vk/Desktop/llvm/build/bin/../include/c++/v1/string:966:19: note:
candidate function
basic_string& assign(const basic_string& __str, size_type __pos, size_type
__n=npos);
^
/Users/vk/Desktop/llvm/build/bin/../include/c++/v1/string:968:19: note:
candidate function
basic_string& assign(__self_view __sv, size_type pos, size_type n=npos);
```
This has broken our internal arm test suite.
I suspect this was caused by libcxx/r276238. I don't think this functionality
should break C++11 code.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>