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: unassignedclangb...@nondot.org
          Reporter: v...@apple.com
                CC: llvm-bugs@lists.llvm.org, mclow.li...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to