[llvm-bugs] [Bug 28772] New: libcxx's string_view breaks C++11 code (r276238)

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jul 29 11:34:25 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=28772

            Bug ID: 28772
           Summary: libcxx's string_view breaks C++11 code (r276238)
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: vsk at apple.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com
    Classification: Unclassified

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160729/cb0144e9/attachment-0001.html>


More information about the llvm-bugs mailing list