Boost logo

Boost :

Subject: [boost] [test] showtopper for release 1.49 - std::forward not found when compiling with clang 3.0 c++0x mode.
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2012-01-02 13:28:23


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk