http://llvm.org/bugs/show_bug.cgi?id=15918
Bug ID: 15918
Summary: libc++ <functional> regression?
Product: libc++
Version: 3.2
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: All Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
It's been a few months before I last played with libc++ and clang.
Now my old piece of code no longer compiles with the latest libc++ SVN and
clang 3.2
########### TEST CODE ############
#include <functional>
class Foo {
public:
void bar(int k) { }
};
int main() {
Foo f;
std::function<void(int)> fun = std::bind(&Foo::bar, &f,
std::placeholders::_1);
fun(10);
return 0;
}
##################################
This kind of code used to work. I have always built libc++ with libc++abi on my
Ubuntu 12.04.2 LTS. Have I missed something?
I get a massive amount of error output due to:
In file included from testClang.cpp:1:
/usr/include/c++/v1/functional:996:11: error: no matching constructor for
initialization of '__compressed_pair<std::__1::__bind<void (Foo::*)(int), Foo
*, std::__1::placeholders::__ph<1> &>,
std::__1::allocator<std::__1::__bind<void (Foo::*)(int), Foo *,
std::__1::placeholders::__ph<1> &> > >'
: __f_(piecewise_construct, _VSTD::forward_as_tuple(__f),
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/functional:1035:17: note: in instantiation of member
function 'std::__1::__function::__func<std::__1::__bind<void (Foo::*)(int), Foo
*, std::__1::placeholders::__ph<1> &>,
std::__1::allocator<std::__1::__bind<void (Foo::*)(int), Foo *,
std::__1::placeholders::__ph<1> &> >, void (int)>::__func' requested here
::new (__p) __func(__f_.first(), __f_.second());
^
/usr/include/c++/v1/functional:1277:26: note: in instantiation of member
function 'std::__1::__function::__func<std::__1::__bind<void (Foo::*)(int), Foo
*, std::__1::placeholders::__ph<1> &>,
std::__1::allocator<std::__1::__bind<void (Foo::*)(int), Foo *,
std::__1::placeholders::__ph<1> &> >, void (int)>::__clone' requested here
::new (__f_) _FF(_VSTD::move(__f));
^
testClang.cpp:10:34: note: in instantiation of function template specialization
'std::__1::function<void (int)>::function<std::__1::__bind<void (Foo::*)(int),
Foo *, std::__1::placeholders::__ph<1> &> >'
requested here
std::function<void(int)> fun = std::bind(&Foo::bar, &f,
std::placeholders::_1);
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs