Boost C++ Libraries: Ticket #5632: regex::str() method broken https://svn.boost.org/trac10/ticket/5632 <p> The str() method is not returning a string representation of the regular expression after instantiation of a regex. </p> <p> Example program: </p> <pre class="wiki">#include &lt;iostream&gt; #include &lt;boost/regex.hpp&gt; int main(int argc, char *argv[]) { boost::regex foo("foo"); std::cout &lt;&lt; foo.str() &lt;&lt; std::endl; } </pre><p> merely prints an empty line rather than "foo". </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5632 Trac 1.4.3 John Maddock Thu, 07 Jul 2011 10:52:03 GMT <link>https://svn.boost.org/trac10/ticket/5632#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5632#comment:1</guid> <description> <p> Works for me with both VC10 and g++/Linux. </p> <p> What platform/compiler are you using, Boost version also please. </p> <p> Thanks, John. </p> </description> <category>Ticket</category> </item> <item> <author>Chris Burghart <burghart@…></author> <pubDate>Thu, 07 Jul 2011 16:33:42 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5632#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5632#comment:2</guid> <description> <p> Boost version is 1.46.0 (see original bug report). Platform/compiler is a Fedora 15 Linux system with g++ 4.6.0. </p> <p> The program works as expected on a RHEL 5 Linux system with g++ 4.1.2 and boost 1.33.1. </p> <p> It also works fine on a Mac OS X 10.8.0 machine with boost 1.41. </p> </description> <category>Ticket</category> </item> <item> <author>Chris Burghart <burghart@…></author> <pubDate>Thu, 07 Jul 2011 16:34:54 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5632#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5632#comment:3</guid> <description> <p> Oops, forgot to note that the compiler for the Mac OS test was g++ 4.2.1. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Thu, 07 Jul 2011 17:23:44 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5632#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5632#comment:4</guid> <description> <p> Hmmm, still can't reproduce with gcc-4.6.0 on Ubuntu. In order to save me from having to install yet another virtual machine, can you step through the str() method and see what's going on? </p> <p> Thanks! John. </p> </description> <category>Ticket</category> </item> <item> <author>Chris Burghart <burghart@…></author> <pubDate>Thu, 07 Jul 2011 19:07:53 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5632#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5632#comment:5</guid> <description> <p> Stepping through the str() call pointed out my problem, when I saw that the headers being used were coming from a Boost installation under /usr/local (a Boost 1.44 copy which I did not realize was there). I thought I only had Boost 1.46 from a standard package installation under /usr. </p> <p> With no special compiler flags, the 1.44 headers were being loaded from /usr/local/include, but the program was linking with the 1.46 library in /usr/lib. That seems to trigger the problem, likely related to different inlined implementations of boost::basic_regex::str(). </p> <p> Regardless, things work correctly if I build strictly with either the 1.44 copy of Boost or the 1.46 copy. I.e., it's my own dang fault. </p> <p> Sorry for the trouble! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Thu, 14 Jul 2011 10:34:35 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/5632#comment:6 https://svn.boost.org/trac10/ticket/5632#comment:6 <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">invalid</span> </li> </ul> Ticket