Boost C++ Libraries: Ticket #588: mpl::remove compile error with gcc 4.1.0 https://svn.boost.org/trac10/ticket/588 <pre class="wiki">The following four lines fail to compile using gcc 4.1.0 with boost 1.33.1: #include &lt;boost/mpl/vector.hpp&gt; #include &lt;boost/mpl/remove.hpp&gt; template &lt;typename&gt; struct X { struct type {}; }; typedef boost::mpl::remove&lt;boost::mpl::vector&lt;int&gt;, X&lt;int&gt;::type&gt;::type T; Error: boost/mpl/aux_/preprocessed/gcc/template_arity.hpp: In instantiation of ‘const int boost::mpl::aux::template_arity_impl&lt;X&lt;int&gt;::type, 1&gt;::value’: boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:93: instantiated from ‘const int boost::mpl::aux::template_arity&lt;X&lt;int&gt;::type&gt;::value’ boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:98: instantiated from ‘boost::mpl::aux::template_arity&lt;X&lt;int&gt;::type&gt;’ boost/mpl/aux_/preprocessed/gcc/full_lambda.hpp:123: instantiated from ‘boost::mpl::lambda&lt;boost::mpl::same_as&lt;X&lt;int&gt;::type&gt;, mpl_::void_, mpl_::int_&lt;1&gt; &gt;’ boost/mpl/remove_if.hpp:57: instantiated from ‘boost::mpl::aux::remove_if_impl&lt;boost::mpl::vector&lt;int, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na&gt;, boost::mpl::same_as&lt;X&lt;int&gt;::type&gt;, boost::mpl::back_inserter&lt;boost::mpl::vector0&lt;mpl_::na&gt; &gt; &gt;’ boost/mpl/remove.hpp:33: instantiated from ‘boost::mpl::aux::remove_impl&lt;boost::mpl::vector&lt;int, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na&gt;, X&lt;int&gt;::type, boost::mpl::back_inserter&lt;boost::mpl::vector0&lt;mpl_::na&gt; &gt; &gt;’ boost/mpl/remove.hpp:48: instantiated from ‘boost::mpl::remove&lt;boost::mpl::vector&lt;int, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na&gt;, X&lt;int&gt;::type, mpl_::na&gt;’ t.cpp:4: instantiated from here boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:85: error: call of overloaded ‘arity_helper(boost::mpl::aux::type_wrapper&lt;X&lt;int&gt;::type&gt;, boost::mpl::aux::arity_tag&lt;1&gt;)’ is ambiguous boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:30: note: candidates are: char (&amp; boost::mpl::aux::arity_helper(...))[1] boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:37: note: char (&amp; boost::mpl::aux::arity_helper(boost::mpl::aux::type_wrapper&lt;F&lt;T1&gt; &gt;, boost::mpl::aux::arity_tag&lt;1&gt;))[2] [with F = X&lt; &lt;template-parameter-1-1&gt; &gt;::type, T1 = int] boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:37: note: char (&amp; boost::mpl::aux::arity_helper(boost::mpl::aux::type_wrapper&lt;F&lt;T1&gt; &gt;, boost::mpl::aux::arity_tag&lt;1&gt;))[2] [with F = X&lt; &lt;template-parameter-1-1&gt; &gt;::type, T1 = int] The code compiles fine with gcc 4.0.2. </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/588 Trac 1.4.3 eelis Sat, 20 May 2006 22:28:40 GMT <link>https://svn.boost.org/trac10/ticket/588#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/588#comment:1</guid> <description> <pre class="wiki">Logged In: YES user_id=832319 The error is caused by the following GCC bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27689 </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Aleksey Gurtovoy</dc:creator> <pubDate>Mon, 09 Jul 2007 07:02:24 GMT</pubDate> <title>severity set https://svn.boost.org/trac10/ticket/588#comment:2 https://svn.boost.org/trac10/ticket/588#comment:2 <ul> <li><strong>severity</strong> → <span class="trac-field-new">Problem</span> </li> </ul> Ticket Aleksey Gurtovoy Sat, 21 Jun 2008 03:21:46 GMT status, resolution changed https://svn.boost.org/trac10/ticket/588#comment:3 https://svn.boost.org/trac10/ticket/588#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">fixed</span> </li> </ul> <p> According to <a class="ext-link" href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27689#c7"><span class="icon">​</span>http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27689#c7</a>, the bug has been fixed in GCC 4.1.2. </p> <p> I'm marking this as closed. </p> Ticket