Bug 29525 - boost 1.34.0 (testing release) mpl multiset test fails to compile
Summary: boost 1.34.0 (testing release) mpl multiset test fails to compile
Status: RESOLVED DUPLICATE of bug 29518
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.1.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-20 14:13 UTC by Phil Richards
Modified: 2006-10-20 14:34 UTC (History)
6 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
gzip'd preprocessed output of libs/mpl/test/multiset.cpp from boost 1.34 branch (108.73 KB, application/octet-stream)
2006-10-20 14:15 UTC, Phil Richards
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Phil Richards 2006-10-20 14:13:15 UTC
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 };
Comment 1 Phil Richards 2006-10-20 14:15:29 UTC
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
Comment 2 Richard Biener 2006-10-20 14:34:24 UTC

*** This bug has been marked as a duplicate of 29518 ***