Boost C++ Libraries: Ticket #9544: gcc 4.9.0 -std=c++1y breakage https://svn.boost.org/trac10/ticket/9544 <p> The program below fails to compile with development gcc in C++1y mode; it works in C++11 mode. I don't know whether this is a fault in gcc or in boost, but thought an early warning was worth providing. This is with the current super-project master branch; I believe it also fails on develop. </p> <pre class="wiki">llc[900]$ cat /tmp/bre.cc #include &lt;boost/regex.hpp&gt; const boost::regex e("AB"); llc[901]$ g++ --version g++ (GCC) 4.9.0 20140104 (experimental) Copyright (C) 2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. llc[902]$ g++ -std=c++11 -I/opt/boost -c /tmp/bre.cc llc[903]$ g++ -std=c++1y -I/opt/boost -c /tmp/bre.cc In file included from /opt/boost/boost/regex/v4/regex.hpp:70:0, from /opt/boost/boost/regex.hpp:31, from /tmp/bre.cc:1: /opt/boost/boost/regex/v4/basic_regex_creator.hpp: In member function ‘boost::re_detail::re_literal* boost::re_detail::basic_regex_creator&lt;charT, traits&gt;::append_literal(charT)’: /opt/boost/boost/regex/v4/basic_regex_creator.hpp:347:24: error: lvalue required as increment operand ++(result-&gt;length); ^ In file included from /opt/boost/boost/regex/v4/regex.hpp:73:0, from /opt/boost/boost/regex.hpp:31, from /tmp/bre.cc:1: /opt/boost/boost/regex/v4/basic_regex_parser.hpp: In member function ‘bool boost::re_detail::basic_regex_parser&lt;charT, traits&gt;::parse_repeat(std::size_t, std::size_t)’: /opt/boost/boost/regex/v4/basic_regex_parser.hpp:974:21: error: lvalue required as decrement operand --(lit-&gt;length); </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9544 Trac 1.4.3 Marshall Clow Sat, 04 Jan 2014 21:46:29 GMT <link>https://svn.boost.org/trac10/ticket/9544#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9544#comment:1</guid> <description> <p> Could you try this program with the gcc that you are using, please? </p> <pre class="wiki">struct Foo { int length; }; int main () { Foo * p = new Foo { 0 }; ++(p-&gt;length); return 0; } </pre><p> Thanks! </p> </description> <category>Ticket</category> </item> <item> <author>Peter A. Bigot <pab@…></author> <pubDate>Sat, 04 Jan 2014 22:46:45 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9544#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9544#comment:2</guid> <description> <p> No issues. </p> <pre class="wiki">llc[1036]$ g++ --version g++ (GCC) 4.9.0 20140104 (experimental) Copyright (C) 2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. llc[1037]$ g++ -std=c++11 -c /tmp/f.cc llc[1038]$ g++ -std=c++1y -c /tmp/f.cc llc[1039]$ </pre> </description> <category>Ticket</category> </item> <item> <author>Peter A. Bigot <pab@…></author> <pubDate>Sun, 05 Jan 2014 04:18:17 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9544#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9544#comment:3</guid> <description> <p> See the boost-dev mailing list for information relevant to this bug. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Sun, 05 Jan 2014 04:33:34 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9544#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9544#comment:4</guid> <description> <p> [ Marshall posting for Peter ] </p> <p> This issue arose as of <a class="ext-link" href="http://gcc.gnu.org/viewcvs/gcc?view=revision&amp;revision=197248"><span class="icon">​</span>GCC SVN commit 197248</a> which implements <a class="ext-link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3582.html"><span class="icon">​</span>N3582</a>. It occurs because the <a class="ext-link" href="http://gcc.gnu.org/viewcvs/gcc/trunk/gcc/cp/parser.c?r1=197248&amp;r2=197247&amp;pathrev=197248"><span class="icon">​</span>change on line 4109</a> preserves parentheses at the front end (with that change reverted, gcc works correctly). </p> <p> This is now <a class="ext-link" href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59681"><span class="icon">​</span>PR C++/59681</a>. The fix in GCC is not trivial, so I've just made <a class="ext-link" href="https://github.com/boostorg/regex/pull/1"><span class="icon">​</span>pull #1</a> so the trivial fix for boost (remove the parens) can be applied. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Thu, 13 Nov 2014 16:43:40 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/9544#comment:5 https://svn.boost.org/trac10/ticket/9544#comment:5 <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">worksforme</span> </li> </ul> <p> This all appears to be working correctly in master and develop with gcc-4.9.0 and -std=gnu++1y so closing down. </p> Ticket