Attached is a preprocessed file that generates the following error (just the first one of a group shown): % g++ -ftemplate-depth-128 -O0 -fno-inline -Wall -g -fPIC -D_GLIBCXX_DEBUG=1 -DBOOST_ALL_NO_LIB=1 -I. -c -o multiset.o libs/mpl/test/multiset.cpp libs/mpl/test/multiset.cpp: In function 'void count_test() [with T = test_data<boost::mpl::multiset0<0> >]': libs/mpl/test/multiset.cpp:75: instantiated from here libs/mpl/test/multiset.cpp:61: error: '(((int)boost::mpl::count_impl<boost::mpl::aux::multiset_tag>::apply<boost::mpl::multiset0<0>, int>::value) == 0)' is not a valid template argument for type 'bool' because it is a non-constant expression libs/mpl/test/multiset.cpp:61: error: no matching function for call to 'assertion_failed(mpl_::failed************ mpl_::assert_relation<equal, 0l, 0l>::************)' ...etc... The (non-processed) line that causes this is: { MPL_ASSERT_RELATION( ( count<BOOST_DEDUCED_TYPENAME T::s0,int>::value ), ==, 0 ); //... } This problem also appears to exist on 4.0.3 and 4.1.0. (See, for example, the reports on http://engineering.meta-comm.com/boost-regression/CVS-RC_1_34_0/developer/mpl_release.html) What is interesting(?) is that if the following line is inserted before the MPL_ASSERT_RELATION line, then the error goes away: enum { v1 = count<typename T::s0,int>::value };
Created attachment 12469 [details] gzip'd preprocessed output of libs/mpl/test/multiset.cpp from boost 1.34 branch Generated with: g++ -ftemplate-depth-128 -O0 -fno-inline -Wall -g -fPIC -D_GLIBCXX_DEBUG=1 -DBOOST_ALL_NO_LIB=1 -I. libs/mpl/test/multiset.cpp -E >~/multiset.i
*** This bug has been marked as a duplicate of 29518 ***