From owner-freebsd-current@FreeBSD.ORG Wed Jan 29 02:27:54 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6CD19334; Wed, 29 Jan 2014 02:27:54 +0000 (UTC) Received: from smtpout3.timeweb.ru (smtpout3.timeweb.ru [92.53.117.25]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2311911F1; Wed, 29 Jan 2014 02:27:53 +0000 (UTC) Received: from [213.148.20.85] (helo=hive.panopticon) by smtp.timeweb.ru with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1W8KsS-0001Lf-El; Wed, 29 Jan 2014 06:27:44 +0400 Received: from hades.panopticon (hades.panopticon [192.168.0.32]) by hive.panopticon (Postfix) with ESMTP id 004B248C; Wed, 29 Jan 2014 06:27:43 +0400 (MSK) Received: by hades.panopticon (Postfix, from userid 1000) id C04405E50; Wed, 29 Jan 2014 06:27:43 +0400 (MSK) Date: Wed, 29 Jan 2014 06:27:43 +0400 From: Dmitry Marakasov To: freebsd-current@FreeBSD.org Subject: System libc++ isn't fully compatible with clang 3.4 from ports Message-ID: <20140129022743.GO52820@hades.panopticon> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.5.22 (2013-10-16) Cc: theraven@FreeBSD.org, brooks@FreeBSD.org, dim@FreeBSD.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2014 02:27:54 -0000 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 #include int main() { std::function 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 '' cannot bind to lvalue of type '' : value(__t.get()) ^ ~~~~~~~~~ /usr/include/c++/v1/tuple:444:8: note: in instantiation of member function 'std::__1::__tuple_leaf<0, &&, 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<, std::__1::allocator< >, void ()>::__func' requested here ::new (__f_) _FF(_VSTD::move(__f)); ^ test.cc:5:28: note: in instantiation of function template specialization 'std::__1::function::function< >' requested here std::function 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< > &&, 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<, std::__1::allocator< >, 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::function< >' requested here std::function 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@amdmi3.ru ..: jabber: amdmi3@jabber.ru http://www.amdmi3.ru