Bug 194603

Summary: Error when using std::function in libc++ and clang with c++11
Product: Base System Reporter: Enrique Fynn <me>
Component: miscAssignee: David Chisnall <theraven>
Status: Closed FIXED    
Severity: Affects Many People CC: bdrewery
Priority: ---    
Version: CURRENT   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
bug test none

Description Enrique Fynn 2014-10-26 03:28:38 UTC
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.
Comment 1 John Marino freebsd_committer freebsd_triage 2014-11-01 12:22:07 UTC
I'll let brooks@ have the honor...
Comment 2 Brooks Davis freebsd_committer freebsd_triage 2014-11-18 23:20:27 UTC
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.
Comment 3 David Chisnall freebsd_committer freebsd_triage 2014-11-19 08:39:36 UTC
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.
Comment 4 Bryan Drewery freebsd_committer freebsd_triage 2015-04-07 16:01:41 UTC
Seems fixed after r277217