[shared_ptr] Bug in perfect forwarding test?

Now that rvalue refs are enabled for VC++10 the perfect forwarding test fails: http://tinyurl.com/367o3ab This looks like a legitimate failure to me, as the constructor to Y requires an "int&" non-const reference, but the make_shared_ptr function passes a "const int&". Ah... actually this may be to do with the fact that the header is predicated on BOOST_HAS_VARIADIC_TMPL as well as BOOST_HAS_RVALUE_REFS where as the test case is only predicated on BOOST_HAS_RVALUE_REFS? BTW there's an rvalue-refs related failure with gcc-4.5 in C++0x mode as well: http://tinyurl.com/37quwbj Cheers, John.

John Maddock wrote:
Now that rvalue refs are enabled for VC++10 the perfect forwarding test fails: http://tinyurl.com/367o3ab
This looks like a legitimate failure to me, as the constructor to Y requires an "int&" non-const reference, but the make_shared_ptr function passes a "const int&". Ah... actually this may be to do with the fact that the header is predicated on BOOST_HAS_VARIADIC_TMPL as well as BOOST_HAS_RVALUE_REFS where as the test case is only predicated on BOOST_HAS_RVALUE_REFS?
Yes, it seems so. The non-variadic version doesn't attempt perfect forwarding at all. Patched in trunk.
BTW there's an rvalue-refs related failure with gcc-4.5 in C++0x mode as well: http://tinyurl.com/37quwbj
These should be fixed now. Interesting that VC10 doesn't complain about them too.
participants (2)
-
John Maddock
-
Peter Dimov