I&#39;m not sure if I&#39;m missing something here, but I think this is a bug.<br><br>I&#39;m trying to compile the following with gcc4.1.3 on Ubuntu 7.10:<br>$ g++ -v<br>Using built-in specs.<br>Target: i486-linux-gnu<br>
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.1.3 --program-suffix=-
4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-checking=release i486-linux-gnu<br>Thread model: posix<br>gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)<br>
<br><br>#include &lt;boost/regex.hpp&gt;<br><br>int main()<br>{<br>&nbsp; using namespace boost;<br><br>&nbsp; std::string str; <br>&nbsp; regex re(&quot;.&quot;);<br>&nbsp; cmatch what;<br><br>&nbsp; regex_match(str, what, re);<br><br>&nbsp; return 0;
<br>}<br><br>GCC doesn&#39;t manage to find the right overload of regex_match and says only this:<br><br>lala.cpp: In function 'int main()':<br>lala.cpp:11: error: no matching function for call to 'regex_match(std::string&amp;, boost::cmatch&amp;, boost::regex&amp;)'
<br>/usr/local/src/boost/trunk/boost/regex/v4/regex_match.hpp:80: note: candidates are: bool boost::regex_match(const std::basic_string&lt;charT, ST, SA&gt;&amp;, boost::match_results&lt;typename std::basic_string&lt;charT, ST, SA&gt;::const_iterator, Allocator&gt;&amp;, const boost::basic_regex&lt;charT, traits&gt;&amp;, boost::regex_constants::match_flag_type) [with ST = std::char_traits&lt;char&gt;, SA = std::allocator&lt;char&gt;, Allocator = std::allocator&lt;boost::sub_match&lt;const char*&gt; &gt;, charT = char, traits = boost::regex_traits&lt;char, boost::cpp_regex_traits&lt;char&gt; &gt;]
<br><br>It compiles fine if you instead pass str.c_str() as the first argument. On the other hand, If you explicitly qualify the regex types with boost::, gcc spews out the attached misery-ball. AFAIK, these all work on msvc9.
<br><br>Is the example above supposed to work?<br><br>Cheers,<br>Darren<br>