Boost C++ Libraries: Ticket #8774: use of dectype in result_of gives errors in spirit parser on gcc-4.8.1 https://svn.boost.org/trac10/ticket/8774 <p> The following snippet compiles and runs fine on boost-1.53 and earlier using gcc-4.8.1, but fails to compile on boost-1.54. </p> <pre class="wiki">//#define BOOST_RESULT_OF_USE_TR1 #include &lt;boost/spirit/include/qi.hpp&gt; #include &lt;boost/spirit/include/phoenix_operator.hpp&gt; int main() { namespace qi = boost::spirit::qi; qi::rule&lt;const char *, void(int &amp;)&gt; foo = qi::int_[qi::_r1 = qi::_1]; qi::rule&lt;const char *, int()&gt; start = foo(qi::_val); const char *beg = "5", *end = beg+strlen(beg); int val; if(parse(beg, end, start, val)) std::cout &lt;&lt; val &lt;&lt; std::endl; else std::cout &lt;&lt; "error"; } </pre><p> The compile error output is attached to this ticket. The error goes away by uncommenting the first line. </p> <p> It seems that boost-1.54 enables by default the use of decltype in the implementation of boost::result_of but it isn't doing what it's suppose to do. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8774 Trac 1.4.3 rodolfo@… Wed, 03 Jul 2013 17:09:32 GMT attachment set https://svn.boost.org/trac10/ticket/8774 https://svn.boost.org/trac10/ticket/8774 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">errors.txt</span> </li> </ul> <p> gcc-4.8.1 compile output with errors </p> Ticket ttan@… Fri, 06 Sep 2013 04:10:26 GMT <link>https://svn.boost.org/trac10/ticket/8774#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8774#comment:1</guid> <description> <p> Same here. my code that compiles OK with STL's distro9.2(gcc4.7.1 +boost 1.5.0) yields errors regarding result_of when compiling with distro 11.1(gcc 4.8.1 +boost 1.54). Adding -DBOOST_RESULT_OF_USE_TR1 to g++ fixes the problem. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 27 Oct 2014 18:32:44 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8774#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8774#comment:2</guid> <description> <p> This bug seems fixed in Boost 1.56.0. The above code compiles under RHEL 7 (gcc 4.8.2) in C++98 and C++11 mode. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Mon, 27 Oct 2014 23:50:50 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/8774#comment:3 https://svn.boost.org/trac10/ticket/8774#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> Confirmed. This has been fixed. I'm closing this now. </p> Ticket