Boost C++ Libraries: Ticket #2842: dynamic_bitset.hpp fails to compile with g++ (Ubuntu 4.3.3-5ubuntu2) 4.3.3 https://svn.boost.org/trac10/ticket/2842 <p> source/boost/dynamic_bitset/dynamic_bitset.hpp: In member function ‘size_t boost::dynamic_bitset&lt;Block, Allocator&gt;::count() const’: source/boost/dynamic_bitset/dynamic_bitset.hpp:1021: error: ‘mode’ cannot appear in a constant-expression source/boost/dynamic_bitset/dynamic_bitset.hpp:1021: error: template argument 1 is invalid source/boost/dynamic_bitset/dynamic_bitset.hpp:1021: error: expected `&gt;' before ‘*’ token source/boost/dynamic_bitset/dynamic_bitset.hpp:1021: error: expected `(' before ‘*’ token source/boost/dynamic_bitset/dynamic_bitset.hpp:1021: error: expected primary-expression before ‘&gt;’ token </p> <p> Seems like this update to gcc does not like const values passed as parameters to templates... </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2842 Trac 1.4.3 Zara <zaravalle@…> Thu, 30 Apr 2009 11:14:58 GMT <link>https://svn.boost.org/trac10/ticket/2842#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2842#comment:1</guid> <description> <p> The part that is not identified as constant is 'no_padding', participant in 'mode'. The other part, 'enough_table_width' is correctly identified as const. </p> </description> <category>Ticket</category> </item> <item> <author>Zara <zaravalle@…></author> <pubDate>Thu, 30 Apr 2009 11:22:20 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2842#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2842#comment:2</guid> <description> <p> Solution (apparently) found: The current file documents something introduced for GCC 3.4: </p> <blockquote class="citation"> <blockquote class="citation"> <blockquote> <p> <em> NOTE: Explicitly qualifying "bits_per_block" to workaround </em> regressions of gcc 3.4.x const bool no_padding = </p> <blockquote> <p> dynamic_bitset&lt;Block, Allocator&gt;::bits_per_block </p> </blockquote> </blockquote> <h2 class="section" id="CHAR_BITsizeofBlock">CHAR_BIT * sizeof(Block);</h2> </blockquote> </blockquote> <p> Removing the explicit qualification compiles with GCC 4.3. To be tested: does the compiled object work OK? </p> <blockquote class="citation"> <blockquote class="citation"> <blockquote> <p> const bool no_padding = bits_per_block == CHAR_BIT * sizeof(Block); </p> </blockquote> </blockquote> </blockquote> <p> HTH </p> </description> <category>Ticket</category> </item> <item> <author>zaravalle@…</author> <pubDate>Thu, 07 May 2009 09:17:06 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/2842 https://svn.boost.org/trac10/ticket/2842 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">dynamic_bitset.patch</span> </li> </ul> <p> Suggested patch that fixes this ticket </p> Ticket zaravalle@… Thu, 07 May 2009 09:20:42 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/2842#comment:3 https://svn.boost.org/trac10/ticket/2842#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Attached file seems to correct this problem. Explicit qualification of bits_per_block breaks compilation undef gccx 4.3, so the patch just detects this specific compiler and version (and later versions, also), and does not make the explicit qualification in such case. </p> <p> Works OK with gcc 4.1 (Centos 5.x) and gcc 4.3 (ubuntu 9.04) </p> Ticket anonymous Thu, 07 May 2009 13:03:37 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/2842#comment:4 https://svn.boost.org/trac10/ticket/2842#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> Ticket zaravalle@… Thu, 07 May 2009 13:05:16 GMT <link>https://svn.boost.org/trac10/ticket/2842#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2842#comment:5</guid> <description> <p> I have reopened it as I accidentally closed it, but the proposed fix is still valid, from my point of view. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Mon, 11 May 2009 00:16:35 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/2842#comment:6 https://svn.boost.org/trac10/ticket/2842#comment:6 <ul> <li><strong>cc</strong> <span class="trac-author">daniel_james@…</span> added </li> </ul> <p> Hi, I was just looking at this, as I promised I would. But it seems that someone beat me to it and didn't say anything. Changes in trunk: <a class="changeset" href="https://svn.boost.org/trac10/changeset/52879" title="Applying patch fixing problem on certain patch levels for gcc.4.3.3/Ubuntu">[52879]</a>, <a class="changeset" href="https://svn.boost.org/trac10/changeset/52880" title="Fixing the fix by taking into account __GNUC_PATCHLEVEL__ as well">[52880]</a>, <a class="changeset" href="https://svn.boost.org/trac10/changeset/52881" title="Minor comment edit">[52881]</a>. </p> Ticket zaravalle@… Mon, 11 May 2009 05:43:45 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/2842#comment:7 https://svn.boost.org/trac10/ticket/2842#comment:7 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Thanks to all. I have now learned something else about versions and patch levels, by loking at the definitive solution. I suppose now is the right time to close the ticket! </p> Ticket