<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - libc++ <functional> regression?"
href="http://llvm.org/bugs/show_bug.cgi?id=15918">15918</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>libc++ <functional> regression?
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>3.2
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>hhinnant@apple.com
</td>
</tr>
<tr>
<th>Reporter</th>
<td>qiwei.uk@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>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);</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>