Boost C++ Libraries: Ticket #1507: [variant] C4512 warnings from VC8.0 https://svn.boost.org/trac10/ticket/1507 <p> Variant produces a number of C4512 (assignment operator could not be generated) warnings when used in VC8 with warning level 4/code analysis enabled: </p> <pre class="wiki">boost\variant\detail\apply_visitor_delayed.hpp(75) : warning C4512: 'boost::apply_visitor_delayed_t&lt;Visitor&gt;' : assignment operator could not be generated boost\variant\variant.hpp(894) : warning C4512: 'boost::detail::variant::invoke_visitor&lt;Visitor&gt;' : assignment operator could not be generated boost\variant\variant.hpp(1544) : warning C4512: 'boost::variant&lt;T0_,T1,T2&gt;::assigner' : assignment operator could not be generated boost\variant\variant.hpp(650) : warning C4512: 'boost::detail::variant::backup_assigner&lt;Variant,RhsT&gt;' : assignment operator could not be generated </pre><p> The attached patch silences the warnings that i'm seeing in my project. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1507 Trac 1.4.3 Richard Webb <richard.webb@…> Sat, 08 Dec 2007 00:42:36 GMT attachment set https://svn.boost.org/trac10/ticket/1507 https://svn.boost.org/trac10/ticket/1507 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">variant.patch</span> </li> </ul> Ticket Richard Webb <richard.webb@…> Fri, 21 Mar 2008 22:22:54 GMT <link>https://svn.boost.org/trac10/ticket/1507#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1507#comment:1</guid> <description> <p> Running the variant regression tests on VC9 with warning level 4 produces a number of warnings in addition to the above: </p> <pre class="wiki">boost/variant/variant.hpp(532) : warning C4512: 'boost::detail::variant::direct_assigner&lt;T&gt;' : assignment operator could not be generated boost/variant/variant.hpp(695) : warning C4512: 'boost::detail::variant::swap_with&lt;Variant&gt;' : assignment operator could not be generated boost/variant/variant.hpp(751) : warning C4512: 'boost::detail::variant::comparer&lt;Variant,Comp&gt;' : assignment operator could not be generated boost/variant/detail/variant_io.hpp(67) : warning C4512: 'boost::detail::variant::printer&lt;OStream&gt;' : assignment operator could not be generated boost/variant/detail/apply_visitor_binary.hpp(66) : warning C4512: 'boost::detail::variant::apply_visitor_binary_invoke&lt;Visitor,Value1&gt;' : assignment operator could not be generated boost/variant/detail/apply_visitor_binary.hpp(103) : warning C4512: 'boost::detail::variant::apply_visitor_binary_unwrap&lt;Visitor,Visitable2&gt;' : assignment operator could not be generated </pre><p> Theres also an 'unreferenced parameter' warning: </p> <pre class="wiki">boost/variant/variant.hpp(289) : warning C4100: 'operand' : unreferenced formal parameter </pre> </description> <category>Ticket</category> </item> <item> <author>Richard Webb <richard.webb@…></author> <pubDate>Fri, 21 Mar 2008 22:24:05 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/1507 https://svn.boost.org/trac10/ticket/1507 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">variant2.patch</span> </li> </ul> <p> Silence 4512 warnings on VC9 </p> Ticket Richard Webb <richard.webb@…> Mon, 05 May 2008 14:14:49 GMT <link>https://svn.boost.org/trac10/ticket/1507#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1507#comment:2</guid> <description> <p> When building in release mode, VC8/9 also produce some unreachable code warnings: </p> <pre class="wiki">boost\variant\detail\visitation_impl.hpp(205) : warning C4702: unreachable code boost\variant\detail\visitation_impl.hpp(180) : warning C4702: unreachable code boost\variant\detail\visitation_impl.hpp(252) : warning C4702: unreachable code boost\variant\detail\visitation_impl.hpp(280) : warning C4702: unreachable code </pre><p> Attached is a patch for visitation_impl.hpp that uses a pragma to silence these. </p> </description> <category>Ticket</category> </item> <item> <author>Richard Webb <richard.webb@…></author> <pubDate>Mon, 05 May 2008 14:15:03 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/1507 https://svn.boost.org/trac10/ticket/1507 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">visitation_impl.patch</span> </li> </ul> Ticket Richard Webb <richard.webb@…> Sat, 30 May 2009 16:21:16 GMT attachment set https://svn.boost.org/trac10/ticket/1507 https://svn.boost.org/trac10/ticket/1507 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">variant_300509.diff</span> </li> </ul> Ticket Richard Webb <richard.webb@…> Sat, 30 May 2009 16:25:25 GMT milestone changed https://svn.boost.org/trac10/ticket/1507#comment:3 https://svn.boost.org/trac10/ticket/1507#comment:3 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.40.0</span> </li> </ul> <p> It would be nice to have at least the 'unreachable code' and 'unreferenced parameter' warnings fixed in 1.40 (the unreferenced parameter warning in particular causes a lot of noise of VC9/10). </p> <p> The 'assignment operator could not be generated' warnings are less important (i've taken to switching it off globally anyway). </p> Ticket Richard Webb <richard.webb@…> Tue, 10 Nov 2009 13:12:27 GMT <link>https://svn.boost.org/trac10/ticket/1507#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1507#comment:4</guid> <description> <p> A bunch of these have been fixed in <a class="changeset" href="https://svn.boost.org/trac10/changeset/57501" title="Variant: silenced a couple of MSVC warnings created during Spirit test runs">[57501]</a>. </p> </description> <category>Ticket</category> </item> <item> <author>Richard Webb <richard.webb@…></author> <pubDate>Tue, 10 Nov 2009 15:43:51 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/1507#comment:5 https://svn.boost.org/trac10/ticket/1507#comment:5 <ul> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.40.0</span> → <span class="trac-field-new">Boost 1.42.0</span> </li> </ul> <p> Attached an updated patch based on running the current code in VC9. </p> Ticket Richard Webb <richard.webb@…> Tue, 10 Nov 2009 15:44:23 GMT attachment set https://svn.boost.org/trac10/ticket/1507 https://svn.boost.org/trac10/ticket/1507 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">variant101109.patch</span> </li> </ul> Ticket Richard Webb <richard.webb@…> Tue, 10 Nov 2009 15:47:10 GMT <link>https://svn.boost.org/trac10/ticket/1507#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1507#comment:6</guid> <description> <p> The regression tests also cause a bunch of "possible loss of data" warnings that i haven't had a chance to look at. Build log attached if anyone is interested. </p> </description> <category>Ticket</category> </item> <item> <author>Richard Webb <richard.webb@…></author> <pubDate>Tue, 10 Nov 2009 15:47:41 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/1507 https://svn.boost.org/trac10/ticket/1507 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">variant.log</span> </li> </ul> Ticket Richard Webb <richard.webb@…> Wed, 11 Nov 2009 16:48:52 GMT <link>https://svn.boost.org/trac10/ticket/1507#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1507#comment:7</guid> <description> <p> There is also some </p> <p> "warning C4535: calling _set_se_translator() requires /EHa " </p> <p> warnings. As mentioned in the post @ <a class="ext-link" href="http://old.nabble.com/Re%3A-Official-warnings-policy--p26288257.html"><span class="icon">​</span>http://old.nabble.com/Re%3A-Official-warnings-policy--p26288257.html</a>, these can be fixed by setting the asynch-exceptions option in the variant jamfile. </p> </description> <category>Ticket</category> </item> <item> <author>Richard Webb <richard.webb@…></author> <pubDate>Wed, 11 Nov 2009 16:49:24 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/1507 https://svn.boost.org/trac10/ticket/1507 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">variantjam.diff</span> </li> </ul> Ticket anonymous Thu, 12 Nov 2009 08:33:44 GMT <link>https://svn.boost.org/trac10/ticket/1507#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1507#comment:8</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/1507#comment:7" title="Comment 7">Richard Webb &lt;richard.webb@…&gt;</a>: </p> <blockquote class="citation"> <p> There is also some </p> <p> "warning C4535: calling _set_se_translator() requires /EHa " </p> <p> warnings. As mentioned in the post @ <a class="ext-link" href="http://old.nabble.com/Re%3A-Official-warnings-policy--p26288257.html"><span class="icon">​</span>http://old.nabble.com/Re%3A-Official-warnings-policy--p26288257.html</a>, these can be fixed by setting the asynch-exceptions option in the variant jamfile. </p> </blockquote> <p> The right fix should be: </p> <p> project </p> <blockquote> <p> : requirements </p> <blockquote> <p> &lt;source&gt;/boost/test<em>minimal </em></p> </blockquote> <p> ; </p> </blockquote> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Fri, 13 Nov 2009 10:08:47 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1507#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1507#comment:9</guid> <description> <p> Patches are now in Trunk, leaving open till they're in the release branch. </p> <p> John. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Thu, 10 Jun 2010 15:32:19 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/1507#comment:10 https://svn.boost.org/trac10/ticket/1507#comment:10 <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> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/62742" title="Merge variant from the trunk. Fixes #1507">[62742]</a>) Merge variant from the trunk. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1507" title="#1507: Bugs: [variant] C4512 warnings from VC8.0 (closed: fixed)">#1507</a> </p> Ticket