Boost C++ Libraries: Ticket #11517: unused.hpp does not compile with g++ (<= 4.6) and -std=gnu++0x https://svn.boost.org/trac10/ticket/11517 <p> To reproduce, try to execute </p> <pre class="wiki">g++-4.6 -std=gnu++0x -I. -o /tmp/unused.gch boost/fusion/support/unused.hpp </pre><p> I obtain </p> <pre class="wiki">boost/fusion/support/unused.hpp: In member function ‘const boost::fusion::unused_type&amp; boost::fusion::unused_type::operator=(const boost::fusion::unused_type&amp;) const’: boost/fusion/support/unused.hpp:57:9: error: ‘this’ is not a potential constant expression boost/fusion/support/unused.hpp: At global scope: boost/fusion/support/unused.hpp:67:39: error: both ‘const’ and ‘constexpr’ cannot be used here </pre><p> Such code later became acceptable to g++ but they did not backport the fix beyond 4.7.x ( <a class="ext-link" href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54086"><span class="icon">​</span>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54086</a> ). I am able to work around this problem by adding some lines like </p> <pre class="wiki">#if defined(__GXX_EXPERIMENTAL_CXX0X__) &amp;&amp; __GNUC__ == 4 &amp;&amp; __GNUC_MINOR__ &lt;= 6 </pre><p> in the attached file but you probably want a better fix. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11517 Trac 1.4.3 Ben Goodrich <goodrich.ben@…> Thu, 30 Jul 2015 15:33:10 GMT attachment set https://svn.boost.org/trac10/ticket/11517 https://svn.boost.org/trac10/ticket/11517 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">unused.hpp</span> </li> </ul> Ticket Joel de Guzman Fri, 31 Jul 2015 00:45:03 GMT <link>https://svn.boost.org/trac10/ticket/11517#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11517#comment:1</guid> <description> <p> why not just switch to a newer compiler? </p> </description> <category>Ticket</category> </item> <item> <author>Ben Goodrich <goodrich.ben@…></author> <pubDate>Fri, 31 Jul 2015 04:20:32 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11517#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11517#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/11517#comment:1" title="Comment 1">djowel</a>: </p> <blockquote class="citation"> <p> why not just switch to a newer compiler? </p> </blockquote> <p> I personally do use a newer compiler, but I am maintaining a public R package that depends on Boost. Sadly, the officially supported CRAN compiler for Windows is still mingw's g++ 4.6.3 and some users nevertheless prefer to use its incomplete c++0x standard. Another R package maintainer is facing the same problem </p> <p> <a class="ext-link" href="https://www.r-project.org/nosvn/R.check/r-release-windows-ix86+x86_64/odeintr-00install.html"><span class="icon">​</span>https://www.r-project.org/nosvn/R.check/r-release-windows-ix86+x86_64/odeintr-00install.html</a> </p> <p> If you would like me to use my hack fix, I would understand. But mingw 4.6.3 is still listed as on the Boost webpage as one of the "primary test compilers" for Windows, although I guess without the -std=c++0x flag. </p> </description> <category>Ticket</category> </item> <item> <author>Kohei Takahashi <flast@…></author> <pubDate>Fri, 31 Jul 2015 05:29:49 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11517#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11517#comment:3</guid> <description> <p> I will be investigating in this weekend. </p> <p> Joel, is it reasonable for 1.59.0 release? Because I think the fix (perhaps not only for unused.hpp) will affect all around fusion's code. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Fri, 31 Jul 2015 05:59:16 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11517#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11517#comment:4</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/11517#comment:3" title="Comment 3">Kohei Takahashi &lt;flast@…&gt;</a>: </p> <blockquote class="citation"> <p> I will be investigating in this weekend. </p> <p> Joel, is it reasonable for 1.59.0 release? Because I think the fix (perhaps not only for unused.hpp) will affect all around fusion's code. </p> </blockquote> <p> Sure. OK, let's do it. </p> </description> <category>Ticket</category> </item> <item> <author>Kohei Takahashi <flast@…></author> <pubDate>Sun, 02 Aug 2015 15:20:19 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/11517#comment:5 https://svn.boost.org/trac10/ticket/11517#comment:5 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.59.0</span> </li> </ul> <p> Ah, I misunderstood, it's not a big deal. OK, now I opened a PR to fix this issue: <a class="ext-link" href="https://github.com/boostorg/fusion/pull/96"><span class="icon">​</span>https://github.com/boostorg/fusion/pull/96</a> . </p> Ticket Kohei Takahashi <flast@…> Thu, 20 Aug 2015 14:04:59 GMT <link>https://svn.boost.org/trac10/ticket/11517#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11517#comment:6</guid> <description> <p> Joel, it should be fixed in 1.59 release. Please close this ticket. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Thu, 20 Aug 2015 15:04:08 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11517#comment:7 https://svn.boost.org/trac10/ticket/11517#comment:7 <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> Ticket