[cfe-dev] libc++ problem with clang trunk
Howard Hinnant
hhinnant at apple.com
Wed Nov 6 09:53:14 PST 2013
Fixed in r194154.
Howard
On Nov 6, 2013, at 7:40 AM, İsmail Dönmez <ismail at donmez.ws> wrote:
> Hi,
>
> Testcase stolen from #llvm channel, using clang r194134 on Linux x86-64.
> This is also reported as http://llvm.org/bugs/show_bug.cgi?id=17826
>
> [/havana/t/clang]> cat test.cpp
> #include <memory>
> using namespace std;
>
> class test {
> struct private_tag {};
> public:
> test(private_tag) {}
> static shared_ptr<test> make_test() {
> return make_shared<test>(private_tag());
> }
> };
>
> int main()
> {
> auto t = test::make_test();
> }
>
>
> [/havana/t/clang]> clang++ -std=c++11 -stdlib=libc++ test.cpp
> In file included from test.cpp:1:
> In file included from /usr/include/c++/v1/memory:603:
> /usr/include/c++/v1/tuple:267:11: error: rvalue reference to type 'test::private_tag' cannot bind to lvalue of type
> 'test::private_tag'
> : value(__t.get())
> ^ ~~~~~~~~~
> /usr/include/c++/v1/tuple:385:8: note: in instantiation of member function 'std::__1::__tuple_leaf<0, test::private_tag &&,
> false>::__tuple_leaf' requested here
> struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
> ^
> /usr/include/c++/v1/memory:4290:26: note: in instantiation of function template specialization
> 'std::__1::__shared_ptr_emplace<test, std::__1::allocator<test> >::__shared_ptr_emplace<test::private_tag>' requested
> here
> ::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
> ^
> /usr/include/c++/v1/memory:4649:29: note: in instantiation of function template specialization
> 'std::__1::shared_ptr<test>::make_shared<test::private_tag>' requested here
> return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
> ^
> test.cpp:9:24: note: in instantiation of function template specialization 'std::__1::make_shared<test, test::private_tag>'
> requested here
> return make_shared<test>(private_tag());
> ^
> In file included from test.cpp:1:
> In file included from /usr/include/c++/v1/memory:603:
> /usr/include/c++/v1/tuple:268: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");}
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 2 errors generated.
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
More information about the cfe-dev
mailing list