Boost C++ Libraries: Ticket #6029: Boost.Regex incompatible with G++'s Profile features https://svn.boost.org/trac10/ticket/6029 <p> Using a recent G++ (say 4.6), it is possible to enable libstc++ features to profile the use of STL features (see <a class="ext-link" href="http://gcc.gnu.org/onlinedocs/libstdc++/manual/profile_mode.html"><span class="icon">​</span>http://gcc.gnu.org/onlinedocs/libstdc++/manual/profile_mode.html</a>). Boost.Regex (and maybe other libraries, I don't know yet) is not compilable with it: </p> <pre class="wiki">$ g++-mp-4.6 -c -Wall /opt/local/include/boost/regex.hpp -o /tmp/f.o $ g++-mp-4.6 -c -D_GLIBCXX_PROFILE -Wall /opt/local/include/boost/regex.hpp -o /tmp/f.o |&amp; sed 20q In file included from /opt/local/include/boost/functional/hash/hash.hpp:535:0, from /opt/local/include/boost/functional/hash.hpp:6, from /opt/local/include/boost/regex/v4/basic_regex.hpp:23, from /opt/local/include/boost/regex/v4/regex.hpp:67, from /opt/local/include/boost/regex.hpp:31: /opt/local/include/boost/functional/hash/extensions.hpp:36:33: error: template declaration of 'std::size_t boost::hash_value' /opt/local/include/boost/functional/hash/extensions.hpp:36:28: error: reference to 'vector' is ambiguous /opt/local/include/boost/detail/container_fwd.hpp:87:47: error: candidates are: template&lt;class T, class Allocator&gt; struct std::vector /opt/local/include/gcc46/c++/profile/vector:48:11: error: template&lt;class _Tp, class _Allocator&gt; class std::__profile::vector /opt/local/include/boost/functional/hash/extensions.hpp:36:41: error: expected primary-expression before ',' token /opt/local/include/boost/functional/hash/extensions.hpp:36:44: error: expected primary-expression before '&gt;' token /opt/local/include/boost/functional/hash/extensions.hpp:36:46: error: expected primary-expression before 'const' /opt/local/include/boost/functional/hash/extensions.hpp:38:33: error: template declaration of 'std::size_t boost::hash_value' /opt/local/include/boost/functional/hash/extensions.hpp:38:28: error: reference to 'list' is ambiguous /opt/local/include/boost/detail/container_fwd.hpp:86:47: error: candidates are: template&lt;class T, class Allocator&gt; struct std::list /opt/local/include/gcc46/c++/profile/list:42:11: error: template&lt;class _Tp, class _Allocator&gt; class std::__profile::list /opt/local/include/boost/functional/hash/extensions.hpp:38:39: error: expected primary-expression before ',' token /opt/local/include/boost/functional/hash/extensions.hpp:38:42: error: expected primary-expression before '&gt;' token /opt/local/include/boost/functional/hash/extensions.hpp:38:44: error: expected primary-expression before 'const' /opt/local/include/boost/functional/hash/extensions.hpp:46:33: error: template declaration of 'std::size_t boost::hash_value' </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6029 Trac 1.4.3 John Maddock Mon, 17 Oct 2011 12:03:06 GMT owner, component changed https://svn.boost.org/trac10/ticket/6029#comment:1 https://svn.boost.org/trac10/ticket/6029#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">John Maddock</span> to <span class="trac-author">Daniel James</span> </li> <li><strong>component</strong> <span class="trac-field-old">regex</span> → <span class="trac-field-new">hash</span> </li> </ul> <p> Reassigning: this is a Boost.Hash issue. </p> Ticket Akim Demaille <akim.demaille@…> Mon, 17 Oct 2011 12:26:22 GMT <link>https://svn.boost.org/trac10/ticket/6029#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6029#comment:2</guid> <description> <p> FWIW, what was recommended here: <a class="ext-link" href="http://lists.boost.org/Archives/boost/2010/05/167108.php"><span class="icon">​</span>http://lists.boost.org/Archives/boost/2010/05/167108.php</a> (the diff is backwards) does fix the issue for me: </p> <pre class="wiki">--- /tmp/container_fwd.hpp 2011-10-17 14:21:46.000000000 +0200 +++ /opt/local/include/boost/detail/container_fwd.hpp 2011-10-17 14:23:02.000000000 +0200 @@ -15,7 +15,9 @@ #if defined(BOOST_DETAIL_NO_CONTAINER_FWD) \ || ((defined(__GLIBCPP__) || defined(__GLIBCXX__)) \ - &amp;&amp; (defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL))) \ + &amp;&amp; (defined(_GLIBCXX_DEBUG) \ + || defined(_GLIBCXX_PARALLEL) \ + || defined(_GLIBCXX_PROFILE))) \ || BOOST_WORKAROUND(__BORLANDC__, &gt; 0x551) \ || BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x842)) \ || (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) \ </pre><p> I have other issues (with boost/tr1/type_traits.hpp colliding tr1/type_traits), but that should probably be another ticket. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Mon, 17 Oct 2011 20:36:58 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6029#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6029#comment:3</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/75016" title="Detail: Don't forward declare containers for gcc in profile mode. Refs ...">[75016]</a>) Detail: Don't forward declare containers for gcc in profile mode. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6029" title="#6029: Bugs: Boost.Regex incompatible with G++'s Profile features (closed: fixed)">#6029</a>. </p> <p> Also a big clear comment about <code>BOOST_DETAIL_NO_CONTAINER_FWD</code> and a fixed typo. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Mon, 17 Oct 2011 20:40:05 GMT</pubDate> <title>status, component changed https://svn.boost.org/trac10/ticket/6029#comment:4 https://svn.boost.org/trac10/ticket/6029#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>component</strong> <span class="trac-field-old">hash</span> → <span class="trac-field-new">None</span> </li> </ul> <p> Sorry, I didn't notice that the patch in that mail had an extra macro. If possible, can you check that trunk now works for you? </p> Ticket anonymous Tue, 08 Nov 2011 15:04:57 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6029#comment:5 https://svn.boost.org/trac10/ticket/6029#comment:5 <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-new">fixed</span> </li> </ul> <p> I think this was fixed in <a class="changeset" href="https://svn.boost.org/trac10/changeset/75293" title="Merge to release several changes for 1.48. ">[75293]</a>. </p> Ticket