| Summary: | Error when using std::function in libc++ and clang with c++11 | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Enrique Fynn <me> | ||||
| Component: | misc | Assignee: | David Chisnall <theraven> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Many People | CC: | bdrewery | ||||
| Priority: | --- | ||||||
| Version: | CURRENT | ||||||
| Hardware: | amd64 | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
I'll let brooks@ have the honor... I can replicate this on a 10.0 system with both clang 3.5 and a just updated clang-devel so I guess this is either a bug in our installed C++11 headers or an unfixed bug in clang. The former seems more likely so I've assigned this to David to check out. This is a libc++ bug that is fixed upstream. I need to do a new import, but was holding off until C++14 was standardised so that we didn't get the not-quite-C++14 stuff in base. I think now is probably a good time. Seems fixed after r277217 |
Created attachment 148655 [details] bug test clang++-devel (clang 3.6) and clang++3.5, when compiling a simple code, that uses std::function, with the C++11 standard (-std=c++11) it crashes with an error in libc++ (208080): Error: /usr/include/c++/v1/tuple:320:11: error: rvalue reference to type 'void (*)(int)' cannot bind to lvalue of type 'void (*)(int)' : value(__t.get()) The code can be found in the attachment.