Boost C++ Libraries: Ticket #8772: boost.variant broken in combination with g++ 4.6.x series and C++0x https://svn.boost.org/trac10/ticket/8772 <p> We observed compilation errors in case the main header of boost.signals2 has been included. </p> <p> Example code : </p> <pre class="wiki">#include &lt;boost/signals2.hpp&gt; int main() { return 0; } </pre><p> The following call fails with errors </p> <pre class="wiki">g++-4.6.3 --std=c++0x main.cpp -I /opt/boost_1_54_0/ </pre><p> The error message points to some sections in boost.variant recently modified for boost 1.54.0 (I attached the rather lengthly error message). </p> <p> In case c++0x is not activated or a 4.7/4.8-series version is used, the compilation succeeds. </p> <p> We simply excluded the problematic section in file boost/variant/variant.hpp which resolved our compilation problem. </p> <p> I saw that the gcc 4.6 series is not in the list of compilers tested with C++11 enabled but for us this section in variant is the first that fails in case the preprocessor macro BOOST_NO_CXX11_RVALUE_REFERENCES is not set. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8772 Trac 1.4.3 anonymous Wed, 03 Jul 2013 11:59:33 GMT attachment set https://svn.boost.org/trac10/ticket/8772 https://svn.boost.org/trac10/ticket/8772 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">errormessage.txt</span> </li> </ul> <p> The error message generated by g++ 4.6.3 </p> Ticket anonymous Wed, 03 Jul 2013 12:01:57 GMT attachment set https://svn.boost.org/trac10/ticket/8772 https://svn.boost.org/trac10/ticket/8772 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost_1_54_0_variant.patch</span> </li> </ul> <p> Simple fix to disable specific variant optimizations relying on rvalue references. </p> Ticket Antony Polukhin Fri, 12 Jul 2013 13:13:30 GMT <link>https://svn.boost.org/trac10/ticket/8772#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8772#comment:1</guid> <description> <p> This can be fixed by removing <code>typename B1, </code> from first <code>void assign_impl</code>, making it look like: </p> <pre class="wiki"> template &lt;typename RhsT, typename B2&gt; void assign_impl( RhsT&amp; rhs_content , mpl::true_ // has_nothrow_copy , mpl::false_ // is_nothrow_move_constructible , B2 // has_fallback_type ) </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Fri, 12 Jul 2013 13:20:35 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/8772#comment:2 https://svn.boost.org/trac10/ticket/8772#comment:2 <ul> <li><strong>cc</strong> <span class="trac-author">antoshkka@…</span> added </li> </ul> Ticket anonymous Mon, 15 Jul 2013 12:24:03 GMT <link>https://svn.boost.org/trac10/ticket/8772#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8772#comment:3</guid> <description> <p> Agreed, looks better. I didn't see the obvious ... </p> <p> For me this bug can be closed after applying this patch to the trunk. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Fri, 19 Jul 2013 07:52:41 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8772#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8772#comment:4</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/85080" title="Fix compilation of Boost.Variants move assignment for situations when ...">[85080]</a>) Fix compilation of Boost.Variants move assignment for situations when one of the variant template classes has nothrow copy constructor and throwing move constructor (refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8772" title="#8772: Bugs: boost.variant broken in combination with g++ 4.6.x series and C++0x (closed: fixed)">#8772</a>) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Fri, 19 Jul 2013 07:53:23 GMT</pubDate> <title>owner, status changed https://svn.boost.org/trac10/ticket/8772#comment:5 https://svn.boost.org/trac10/ticket/8772#comment:5 <ul> <li><strong>owner</strong> changed from <span class="trac-author">ebf</span> to <span class="trac-author">Antony Polukhin</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Antony Polukhin Sat, 20 Jul 2013 15:32:32 GMT <link>https://svn.boost.org/trac10/ticket/8772#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8772#comment:6</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/85087" title="Fix test case (refs #8772)">[85087]</a>) Fix test case (refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8772" title="#8772: Bugs: boost.variant broken in combination with g++ 4.6.x series and C++0x (closed: fixed)">#8772</a>) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Thu, 25 Jul 2013 08:42:46 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/8772#comment:7 https://svn.boost.org/trac10/ticket/8772#comment:7 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/85157" title="Merge from trunk: * make the library work on exception-disabled ...">[85157]</a>) Merge from trunk: </p> <ul><li>make the library work on exception-disabled environments (fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8717" title="#8717: Bugs: Please make the library work on exception-disabled environments (closed: fixed)">#8717</a>) </li><li>fix compilation of Boost.Variants move assignment for situations when one of the variant template classes has nothrow copy constructor and throwing move constructor (fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8772" title="#8772: Bugs: boost.variant broken in combination with g++ 4.6.x series and C++0x (closed: fixed)">#8772</a>) </li><li>mark move constructor of variant with BOOST_NOEXCEPT_IF (refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7911" title="#7911: Feature Requests: Mark move constructors and move assignments of varint with ... (closed: fixed)">#7911</a>) </li></ul> Ticket Antony Polukhin Thu, 25 Jul 2013 13:20:46 GMT milestone changed https://svn.boost.org/trac10/ticket/8772#comment:8 https://svn.boost.org/trac10/ticket/8772#comment:8 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.55.0</span> </li> </ul> Ticket