Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Mar 2014 17:28:29 +0400
From:      Dmitry Marakasov <amdmi3@amdmi3.ru>
To:        =?utf-8?Q?Jean-S=C3=A9bastien_P=C3=A9dron?= <dumbbell@FreeBSD.org>
Cc:        Koop Mast <kwm@FreeBSD.org>, freebsd-toolchain@freebsd.org
Subject:   Re: Various issues with Clang and libc++ while playing with OpenCL (FYI)
Message-ID:  <20140306132829.GB92463@hades.panopticon>
In-Reply-To: <53170AD1.4090506@FreeBSD.org>
References:  <53170AD1.4090506@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
* Jean-S=C3=A9bastien P=C3=A9dron (dumbbell@FreeBSD.org) wrote:

> 3. Our base libc++ has a bug in the <functional> header. I posted a PR
>    on Mesa bug tracker here, before I found out it was a problem with
>    libc++:
>    https://bugs.freedesktop.org/show_bug.cgi?id=3D75505
>=20
>    Apparently, it's fixed in libc++ upstream, in r199848.

Hm, is this by the chance the same bug as the following?

Either way, it would be nice to get it fixed in 10-stable.

---
% cat 1.cc=20
#include <functional>
int main() { std::function<void()> f =3D [](){}; return 0; }
% clang++ -std=3Dc++11 1.cc=20
% clang++34 -std=3Dc++11 1.cc=20
In file included from 1.cc:1:
In file included from /usr/include/c++/v1/functional:465:
In file included from /usr/include/c++/v1/memory:603:
/usr/include/c++/v1/tuple:320:11: error: rvalue reference to type '<lambd=
a at 1.cc:3:40>' cannot bind to lvalue of type '<lambda at 1.cc:3:40>'
        : value(__t.get())
          ^     ~~~~~~~~~
/usr/include/c++/v1/tuple:444:8: note: in instantiation of member functio=
n 'std::__1::__tuple_leaf<0, <lambda at 1.cc:3:40> &&, false>::__tuple_le=
af' requested here
struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
       ^
/usr/include/c++/v1/functional:1286:26: note: in instantiation of member =
function 'std::__1::__function::__func<<lambda at 1.cc:3:40>, std::__1::a=
llocator<<lambda at 1.cc:3:40> >, void ()>::__func' requested here
            ::new (__f_) _FF(_VSTD::move(__f));
                         ^
1.cc:3:40: note: in instantiation of function template specialization 'st=
d::__1::function<void ()>::function<<lambda at 1.cc:3:40> >' requested he=
re
int main() { std::function<void()> f =3D [](){}; return 0; }
                                       ^
In file included from 1.cc:1:
In file included from /usr/include/c++/v1/functional:465:
In file included from /usr/include/c++/v1/memory:603:
/usr/include/c++/v1/tuple:321:10: error: static_assert failed "Can not co=
py a tuple with rvalue reference member"
        {static_assert(!is_rvalue_reference<_Hp>::value, "Can not copy a =
tuple with rvalue reference member");}
         ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/tuple:320:11: error: rvalue reference to type 'alloca=
tor<[...]>' cannot bind to lvalue of type 'allocator<[...]>'
        : value(__t.get())
          ^     ~~~~~~~~~
/usr/include/c++/v1/tuple:444:8: note: in instantiation of member functio=
n 'std::__1::__tuple_leaf<0, std::__1::allocator<<lambda at 1.cc:3:40> > =
&&, false>::__tuple_leaf' requested here
struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
       ^
/usr/include/c++/v1/functional:1294:34: note: in instantiation of member =
function 'std::__1::__function::__func<<lambda at 1.cc:3:40>, std::__1::a=
llocator<<lambda at 1.cc:3:40> >, void ()>::__func' requested here
            ::new (__hold.get()) _FF(_VSTD::move(__f), allocator<_Fp>(__a=
));
                                 ^
1.cc:3:40: note: in instantiation of function template specialization 'st=
d::__1::function<void ()>::function<<lambda at 1.cc:3:40> >' requested he=
re
int main() { std::function<void()> f =3D [](){}; return 0; }
                                       ^
In file included from 1.cc:1:
In file included from /usr/include/c++/v1/functional:465:
In file included from /usr/include/c++/v1/memory:603:
/usr/include/c++/v1/tuple:321:10: error: static_assert failed "Can not co=
py a tuple with rvalue reference member"
        {static_assert(!is_rvalue_reference<_Hp>::value, "Can not copy a =
tuple with rvalue reference member");}
         ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 errors generated.
---

--=20
Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
amdmi3@amdmi3.ru  ..:  jabber: amdmi3@jabber.ru    http://www.amdmi3.ru



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140306132829.GB92463>