<div dir="ltr"><div><div><br>
<br><br><div class="gmail_quote">On Wed, Nov 6, 2013 at 5:53 PM, Howard Hinnant <span dir="ltr"><<a href="mailto:hhinnant@apple.com" target="_blank">hhinnant@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Fixed in r194154.<br>
<span class=""><font color="#888888"><br>
Howard<br>
</font></span><div class=""><div class="h5"><br>
On Nov 6, 2013, at 7:40 AM, İsmail Dönmez <<a href="mailto:ismail@donmez.ws">ismail@donmez.ws</a>> wrote:<br>
<br>
> Hi,<br>
><br>
> Testcase stolen from #llvm channel, using clang r194134 on Linux x86-64.<br>
> This is also reported as <a href="http://llvm.org/bugs/show_bug.cgi?id=17826" target="_blank">http://llvm.org/bugs/show_bug.cgi?id=17826</a><br>
><br>
> [/havana/t/clang]> cat test.cpp<br>
> #include <memory><br>
> using namespace std;<br>
><br>
> class test {<br>
> struct private_tag {};<br>
> public:<br>
> test(private_tag) {}<br>
> static shared_ptr<test> make_test() {<br>
> return make_shared<test>(private_tag());<br>
> }<br>
> };<br>
><br>
> int main()<br>
> {<br>
> auto t = test::make_test();<br>
> }<br>
><br>
><br>
> [/havana/t/clang]> clang++ -std=c++11 -stdlib=libc++ test.cpp<br>
> In file included from test.cpp:1:<br>
> In file included from /usr/include/c++/v1/memory:603:<br>
> /usr/include/c++/v1/tuple:267:11: error: rvalue reference to type 'test::private_tag' cannot bind to lvalue of type<br>
> 'test::private_tag'<br>
> : value(__t.get())<br>
> ^ ~~~~~~~~~<br>
> /usr/include/c++/v1/tuple:385:8: note: in instantiation of member function 'std::__1::__tuple_leaf<0, test::private_tag &&,<br>
> false>::__tuple_leaf' requested here<br>
> struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...><br>
> ^<br>
> /usr/include/c++/v1/memory:4290:26: note: in instantiation of function template specialization<br>
> 'std::__1::__shared_ptr_emplace<test, std::__1::allocator<test> >::__shared_ptr_emplace<test::private_tag>' requested<br>
> here<br>
> ::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);<br>
> ^<br>
> /usr/include/c++/v1/memory:4649:29: note: in instantiation of function template specialization<br>
> 'std::__1::shared_ptr<test>::make_shared<test::private_tag>' requested here<br>
> return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);<br>
> ^<br>
> test.cpp:9:24: note: in instantiation of function template
specialization 'std::__1::make_shared<test, test::private_tag>'<br>
> requested here<br>
> return make_shared<test>(private_tag());<br>
> ^<br>
> In file included from test.cpp:1:<br>
> In file included from /usr/include/c++/v1/memory:603:<br>
> /usr/include/c++/v1/tuple:268:10: error: static_assert failed "Can not copy a tuple with rvalue reference member"<br>
> {static_assert(!is_rvalue_reference<_Hp>::value, "Can not copy a tuple with rvalue reference member");}<br>
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
> 2 errors generated.<br>
><br>
</div></div><div class=""><div class="h5"><br>
</div></div></blockquote></div><br></div><div>Hi Howard, thank for the super quick fix, it helped us, but I think we have further errors that may be related. (I know this does not fall on you by default and sorry for any presumption.)<br>
</div><br>In the code below, if the Do function is templated (no need to use the template parameter) then the following code will not since last Thursday. This is compiled with <br> clang++ -std=c++11 -stdlib=libc++ -lc++abi -pthread test.cc <br>
<br></div>Using TOT for libc++abi libc++ and clang (clang from llvm repository) on ubuntu 13.10<br><div><br></div><div>Commenting out the template line and swapover the code in main, then this works perfectly OK. Using libstdc++ is also OK.<br>
<br></div><div>I hope this helps.<br></div><div><br>#include <vector><br>#include <future><br>#include <memory><br>#include <thread><br><br><br>struct TestStruct {<br> int index;<br>};<br><br>template<typename T><br>
void Do() {<br> auto v = std::make_shared<std::vector<TestStruct>>(0, TestStruct());<br> auto fut(std::async(std::launch::async, [=] {<br> v->size();<br> }));<br>}<br><br><br>int main() {<br>
Do<TestStruct>();<br> // Do();<br>}<br><br><div class="gmail_extra"><br clear="all"><div><div dir="ltr">Best Regards<br>David Irvine<br><br></div></div></div></div></div>