System libc++ isn't fully compatible with clang 3.4 from ports
Dmitry Marakasov
amdmi3 at amdmi3.ru
Wed Jan 29 02:27:54 UTC 2014
Hi!
JFYI, I've just ran into shortcoming of libc++ from 10-RELEASE when used
with clang 3.4 from ports:
---
% cat test.cc
#include <iostream>
#include <functional>
int main() {
std::function<void()> f = []() { std::cerr << "test\n"; };
return 0;
}
% clang++ -std=c++11 test.cc ---
% clang++34 -std=c++11 test.cc ---
In file included from test.cc:1:
In file included from /usr/include/c++/v1/iostream:38:
In file included from /usr/include/c++/v1/ios:216:
In file included from /usr/include/c++/v1/__locale:15:
In file included from /usr/include/c++/v1/string:434:
In file included from /usr/include/c++/v1/algorithm:627:
In file included from /usr/include/c++/v1/memory:603:
/usr/include/c++/v1/tuple:320:11: error: rvalue reference to type '<lambda at test.cc:5:28>' cannot bind to lvalue of type '<lambda at test.cc:5:28>'
: value(__t.get())
^ ~~~~~~~~~
/usr/include/c++/v1/tuple:444:8: note: in instantiation of member function 'std::__1::__tuple_leaf<0, <lambda at test.cc:5:28> &&, false>::__tuple_leaf' 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 test.cc:5:28>, std::__1::allocator<<lambda at test.cc:5:28> >, void ()>::__func' requested here
::new (__f_) _FF(_VSTD::move(__f));
^
test.cc:5:28: note: in instantiation of function template specialization 'std::__1::function<void ()>::function<<lambda at test.cc:5:28> >' requested here
std::function<void()> f = []() { std::cerr << "test\n"; };
^
In file included from test.cc:1:
In file included from /usr/include/c++/v1/iostream:38:
In file included from /usr/include/c++/v1/ios:216:
In file included from /usr/include/c++/v1/__locale:15:
In file included from /usr/include/c++/v1/string:434:
In file included from /usr/include/c++/v1/algorithm:627:
In file included from /usr/include/c++/v1/memory:603:
/usr/include/c++/v1/tuple:321:10: error: static_assert failed "Can not copy 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 'allocator<[...]>' cannot bind to lvalue of type 'allocator<[...]>'
: value(__t.get())
^ ~~~~~~~~~
/usr/include/c++/v1/tuple:444:8: note: in instantiation of member function 'std::__1::__tuple_leaf<0, std::__1::allocator<<lambda at test.cc:5:28> > &&, 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 test.cc:5:28>, std::__1::allocator<<lambda at test.cc:5:28> >, void ()>::__func' requested here
::new (__hold.get()) _FF(_VSTD::move(__f), allocator<_Fp>(__a));
^
test.cc:5:28: note: in instantiation of function template specialization 'std::__1::function<void ()>::function<<lambda at test.cc:5:28> >' requested here
std::function<void()> f = []() { std::cerr << "test\n"; };
^
In file included from test.cc:1:
In file included from /usr/include/c++/v1/iostream:38:
In file included from /usr/include/c++/v1/ios:216:
In file included from /usr/include/c++/v1/__locale:15:
In file included from /usr/include/c++/v1/string:434:
In file included from /usr/include/c++/v1/algorithm:627:
In file included from /usr/include/c++/v1/memory:603:
/usr/include/c++/v1/tuple:321:10: error: static_assert failed "Can not copy 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.
---
The cause: http://llvm.org/bugs/show_bug.cgi?id=17798, was fixed in
libc++ r194154. We probably need to update libc++ or at least backport
this into stable branches if we want to support clang 3.4 in ports.
--
Dmitry Marakasov . 55B5 0596 FF1E 8D84 5F56 9510 D35A 80DD F9D2 F77D
amdmi3 at amdmi3.ru ..: jabber: amdmi3 at jabber.ru http://www.amdmi3.ru
More information about the freebsd-current
mailing list