[LLVMbugs] [Bug 15918] New: libc++ <functional> regression?

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon May 6 07:32:33 PDT 2013


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: hhinnant at apple.com
          Reporter: qiwei.uk at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130506/900c38be/attachment.html>


More information about the llvm-bugs mailing list