[test] showtopper for release 1.49 - std::forward not found when compiling with clang 3.0 c++0x mode.

Hi, I have created a show stopper ticket https://svn.boost.org/trac/boost/ticket/6345 as after updating the trunk, I'm unable to test any library using Boost.Test. Recent modification on Boost.Test make it unusable with clang 3.0 c++0x due to std::forward missing or not found. clang-darwin.compile.c++ ../../../bin.v2/libs/thread/test/test_thread.test/clang-darwin-3.0x/debug/threading-multi/test_thread.o In file included from test_thread.cpp:16: In file included from ../../../boost/test/unit_test.hpp:19: In file included from ../../../boost/test/test_tools.hpp:328: In file included from ../../../boost/test/tools/impl.hpp:25: ../../../boost/test/tools/assertion.hpp:278:21: error: no member named 'forward' in namespace 'std' : m_value( std::forward<T>(val) ) ~~~~~^ ../../../boost/test/tools/assertion.hpp:278:29: error: 'T' does not refer to a value : m_value( std::forward<T>(val) ) ^ The revision is https://svn.boost.org/trac/boost/changeset/75370 #ifndef BOOST_NO_RVALUE_REFERENCES explicit value_expr( T&& val ) : m_value( std::forward<T>(val) ) #else explicit value_expr( T const& val ) : m_value( val ) #endif #ifndef BOOST_NO_RVALUE_REFERENCES operator->*( T&& v ) const { return value_expr<T>( std::forward<T>( v ) ); } #else operator->*( T const& v ) const { return value_expr<T>( v ); } #endif This has as consequence that the authors developing mainly with this compiler and using Boost.Test to be unable to deliver new modifications. I have added #include <utility> without success. I guess that the standard library doesn't provides this function even if the compiler provides rvalue references. The code should test for a macro that states if std::forward is available. Please could someone help on this issue? Best, Vicente

Vicente J. Botet Escriba <vicente.botet <at> wanadoo.fr> writes:
I have added
#include <utility>
without success.
I guess that the standard library doesn't provides this function even if the compiler provides rvalue references.
The code should test for a macro that states if std::forward is available. Please could someone help on this issue?
Are you saying we consider this compiler supporting rvalue references even though it does not have std::forward? I would say that they are part of the same deal. Or am I missing some include? We should either define BOOST_NO_RVALUE_REFERNCE or add an include. I do not think we want separate macro detecting presence of std::forward. Gennadiy

Le 03/01/12 07:27, Gennadiy Rozental a écrit :
Vicente J. Botet Escriba<vicente.botet<at> wanadoo.fr> writes:
I have added
#include<utility>
without success.
I guess that the standard library doesn't provides this function even if the compiler provides rvalue references.
The code should test for a macro that states if std::forward is available. Please could someone help on this issue? Are you saying we consider this compiler supporting rvalue references even though it does not have std::forward? I would say that they are part of the same deal. Or am I missing some include?
We should either define BOOST_NO_RVALUE_REFERNCE or add an include. I do not think we want separate macro detecting presence of std::forward.
Could some clang expert help to clarify this issue? Best, Vicente

I guess that the standard library doesn't provides this function even if the compiler provides rvalue references.
The code should test for a macro that states if std::forward is available. Please could someone help on this issue?
Are you saying we consider this compiler supporting rvalue references even though it does not have std::forward? I would say that they are part of the same deal. Or am I missing some include?
btw, the boost.heap testsuite currently fails on gcc-4.3/c++0x, because the compiler supports rvalue references, but the library does not implement vector::emplace_back ... tim

Vicente J. Botet Escriba wrote:
I have added
#include <utility>
without success.
I guess that the standard library doesn't provides this function even if the compiler provides rvalue references.
Right. This kind of problem happens when a C++03 standard library is used with a C++11 compiler. Though I'm not confident that it's worth supporting, it is pretty easy to support it, since we are free to implement our own `forward` function. For example, we can use `boost::forward` in boost/move/move.hpp. Regards, Michel

Michel MORIN wrote
Vicente J. Botet Escriba wrote:
I have added
#include <utility>
without success.
I guess that the standard library doesn't provides this function even if the compiler provides rvalue references.
Right. This kind of problem happens when a C++03 standard library is used with a C++11 compiler. Though I'm not confident that it's worth supporting, it is pretty easy to support it, since we are free to implement our own `forward` function. For example, we can use `boost::forward` in boost/move/move.hpp.
Hi, I don't know if we need to support this combination,but do you know why the compiler is using the c++03 library when compiling on C++11 mode? Vicente -- View this message in context: http://boost.2283326.n4.nabble.com/test-showtopper-for-release-1-49-std-forw... Sent from the Boost - Dev mailing list archive at Nabble.com.

Vicente Botet wrote:
I don't know if we need to support this combination,but do you know why the compiler is using the c++03 library when compiling on C++11 mode?
It depends on build settings. I guess, in your build setting, clang uses libstdc++-4.2 (which does not support C++11). If you want to use a C++11 standard library with your clang and you have libc++, you can use libc++ by passing "-stdlib=libc++" to clang. Regards, Michel
participants (5)
-
Gennadiy Rozental
-
Michel Morin
-
Tim Blechmann
-
Vicente Botet
-
Vicente J. Botet Escriba