Boost logo

Boost :

From: Martin Wille (mw8329_at_[hidden])
Date: 2005-03-10 06:04:59


Eric Niebler wrote:
>
> Thanks, Martin! New version posted to the file vault:
>
> http://tinyurl.com/5qhj8
> http://boost-sandbox.sourceforge.net/vault/index.php?directory=eric_niebler
>
> Comments inline:
>
>
> Martin Wille wrote:
>
>>
>> gcc 2.95.3:
>>
>> without #defines: foreach.hpp:27: Invalid token in expression
>> with NO_CONST_RVALUE_DETECTION: same error
>> with NO_RVALUE_DETECTION: same error

> I installed gcc 2.95 and didn't get this error.

This was caused by escaped cr-lf line endings in macro definitions not
being treated correctly by gcc 2.95.3.

I now get these errors for gcc 2.95.3:

regress.cpp: In function `class vector<int,allocator<int> >
to_vector_foreach_byval<int[5]>(int (&)[5])':
regress.cpp:132: instantiated from here
regress.cpp:88: invalid operands `const
boost::foreach_detail_::auto_any_base &' and `int' to binary `operator !='
regress.cpp:132: instantiated from here
regress.cpp:88: invalid operands `const
boost::foreach_detail_::auto_any_base &' and `int' to binary `operator !='
regress.cpp:132: instantiated from here
regress.cpp:88: invalid operands `const
boost::foreach_detail_::auto_any_base &' and `int' to binary `operator !='
regress.cpp: In function `class vector<int,allocator<int> >
to_vector_foreach_byval<char *>(char *&)':
regress.cpp:133: instantiated from here
regress.cpp:88: invalid operands `const
boost::foreach_detail_::auto_any_base &' and `int' to binary `operator !='
regress.cpp:133: instantiated from here
regress.cpp:88: invalid operands `const
boost::foreach_detail_::auto_any_base &' and `int' to binary `operator !='
regress.cpp:133: instantiated from here
regress.cpp:88: invalid operands `const
boost::foreach_detail_::auto_any_base &' and `int' to binary `operator !='
regress.cpp: In function `class vector<int,allocator<int> >
to_vector_foreach_byval<list<int,allocator<int> >
>(list<int,allocator<int> > &)':
regress.cpp:134: instantiated from here
regress.cpp:88: invalid operands `const
boost::foreach_detail_::auto_any_base &' and `int' to binary `operator !='
regress.cpp:134: instantiated from here
regress.cpp:88: invalid operands `const
boost::foreach_detail_::auto_any_base &' and `int' to binary `operator !='
regress.cpp:134: instantiated from here
regress.cpp:88: invalid operands `const
boost::foreach_detail_::auto_any_base &' and `int' to binary `operator !='
regress.cpp: In function `class vector<int,allocator<int> >
to_vector_foreach_byval<pair<boost::counting_iterator<int,boost::use_default,boost::use_default>,boost::counting_iterator<int,boost::use_default,boost::use_default>
>
>(pair<boost::counting_iterator<int,boost::use_default,boost::use_default>,boost::counting_iterator<int,boost::use_default,boost::use_default>
> &)':
regress.cpp:135: instantiated from here
regress.cpp:88: invalid operands `const
boost::foreach_detail_::auto_any_base &' and `int' to binary `operator !='
regress.cpp:135: instantiated from here
regress.cpp:88: invalid operands `const
boost::foreach_detail_::auto_any_base &' and `int' to binary `operator !='
regress.cpp:135: instantiated from here
(+ a lot more messages of the same type)

icc 8.1 works now.

gcc 3.3.5 works.
gcc 3.4.3 works.

gcc-4 without #defines:

/boost/head-regression/boost/boost/iterator/counting_iterator.hpp:32:
error: '(bool)(boost::is_integral<char>::value)' is not a valid template
argument for type 'bool' because it is a non-constant expression
../../../boost/foreach.hpp:281: error: '(size_t)((-1))' is not a valid
template argument for type 'unsigned int' because it is a non-constant
expression
../../../boost/foreach.hpp: In constructor
'boost::foreach_detail_::simple_variant<T>::simple_variant(T*)':
../../../boost/foreach.hpp:245: error: request for member 'address' in
'((boost::foreach_detail_::simple_variant<T>*)this)->boost::foreach_detail_::simple_variant<T>::data',
which is of non-class type 'int'
../../../boost/foreach.hpp: In constructor
'boost::foreach_detail_::simple_variant<T>::simple_variant(const T&)':
../../../boost/foreach.hpp:251: error: request for member 'address' in
'((boost::foreach_detail_::simple_variant<T>*)this)->boost::foreach_detail_::simple_variant<T>::data',
which is of non-class type 'int'
../../../boost/foreach.hpp: In copy constructor
'boost::foreach_detail_::simple_variant<T>::simple_variant(const
boost::foreach_detail_::simple_variant<T>&)':
../../../boost/foreach.hpp:258: error: request for member 'address' in
'((boost::foreach_detail_::simple_variant<T>*)this)->boost::foreach_detail_::simple_variant<T>::data',
which is of non-class type 'int'
../../../boost/foreach.hpp:260: error: request for member 'address' in
'((boost::foreach_detail_::simple_variant<T>*)this)->boost::foreach_detail_::simple_variant<T>::data',
which is of non-class type 'int'
../../../boost/foreach.hpp: In member function 'T*
boost::foreach_detail_::simple_variant<T>::get() const':
../../../boost/foreach.hpp:272: error: request for member 'address' in
'((const
boost::foreach_detail_::simple_variant<T>*)this)->boost::foreach_detail_::simple_variant<T>::data',
which is of non-class type 'int'
../../../boost/foreach.hpp:274: error: request for member 'address' in
'((const
boost::foreach_detail_::simple_variant<T>*)this)->boost::foreach_detail_::simple_variant<T>::data',
which is of non-class type 'int'

gcc-4 with BOOST_FOREACH_NO_RVALUE_DETECTION or with
BOOST_FOREACH_NO_CONST_RVALUE_DETECTION:

/boost/head-regression/boost/boost/iterator/counting_iterator.hpp:32:
error: '(bool)(boost::is_integral<char>::value)' is not a valid template
argument for type 'bool' because it is a non-constant expression.

gcc 3.2.3 without defines:

regress.cpp: In function `std::vector<int, std::allocator<int> >
    to_vector_foreach_byval(Range&) [with Range = int[5]]':
regress.cpp:132: instantiated from here
regress.cpp:88: no match for `bool ? boost::foreach_detail_::rvalue_probe :
    int[5]' operator
regress.cpp: In function `std::vector<int, std::allocator<int> >
    to_vector_foreach_byval(Range&) [with Range = const int[5]]':
regress.cpp:138: instantiated from here
regress.cpp:88: no match for `bool ? boost::foreach_detail_::rvalue_probe :
    const int[5]' operator
regress.cpp: In function `std::vector<int, std::allocator<int> >
    to_vector_foreach_byref(Range&) [with Range = int[5]]':
regress.cpp:144: instantiated from here
regress.cpp:104: no match for `bool ?
boost::foreach_detail_::rvalue_probe :
    int[5]' operator
regress.cpp: In function `std::vector<int, std::allocator<int> >
    to_vector_foreach_byref(Range&) [with Range = const int[5]]':
regress.cpp:150: instantiated from here
regress.cpp:104: no match for `bool ?
boost::foreach_detail_::rvalue_probe :
    const int[5]' operator
regress.cpp: In function `void mutate_foreach_byref(Range&) [with Range =
    int[5]]':
regress.cpp:156: instantiated from here
regress.cpp:119: no match for `bool ?
boost::foreach_detail_::rvalue_probe :
    int[5]' operator

Regards,
m


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