Boost C++ Libraries: Ticket #2294: Please improve test annotation https://svn.boost.org/trac10/ticket/2294 <p> The explicit-failures-markup for the <code>optional_test_ref</code> test is not informative enough to be useful to me. OK, so there's a compiler bug. How does it affect the usability of the library? What actually *is* the behavior of the library when I create optional&lt;T&amp;&gt;? Is it just the address-of operator that's broken, or does the optional not actually store the reference as it should? </p> <p> I'd appreciate it if you could improve this text. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2294 Trac 1.4.3 Dave Abrahams Sat, 06 Sep 2008 03:06:36 GMT <link>https://svn.boost.org/trac10/ticket/2294#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2294#comment:1</guid> <description> <p> I think I understand the bug now (though the text should still be improved) and I have a suggestion to make: on those compilers where the bug exists, make the constructor in question explicit so that you can't mistakenly end up with a dangling reference. I did that by brute force in my local copy by specializing optional&lt;V const&amp;&gt; and adding "explicit" to the ctor. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Dave Abrahams</dc:creator> <pubDate>Mon, 08 Sep 2008 14:43:33 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2294#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2294#comment:2</guid> <description> <p> Suggested new text: </p> <blockquote> <p> This failure is caused by a compiler bug, and as far as we can tell, can't be worked around in the library, although we think the library might be made safer with respect to this bug. </p> </blockquote> <blockquote> <p> Specifics: the following simple test fails when it should succeed. </p> <pre class="wiki"> #include &lt;cassert&gt; int const x = 0; struct A { A(int const&amp; y) { assert(&amp;x == &amp;y); } }; int main() { A a(x); // direct initialization works fine A b = x; // copy initialization causes x to be copied before it is bound } </pre></blockquote> <blockquote> <p> The possible safety enhancement would be to cause the constructor in question to be explicit for optional&lt;T const&amp;&gt;; that would prevent copy initialization. </p> </blockquote> </description> <category>Ticket</category> </item> <item> <dc:creator>Dean Michael Berris</dc:creator> <pubDate>Sun, 28 Nov 2010 23:26:25 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2294#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2294#comment:3</guid> <description> <p> Dave, can you be a little more explicit as to which file this text should go in? I'm prepared to make a patch but I can't see where the expected failure annotation should be changed. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 29 Nov 2010 01:43:53 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2294#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2294#comment:4</guid> <description> <p> It's at <code>status/explicit-failures-markup.xml</code>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Dean Michael Berris</dc:creator> <pubDate>Mon, 29 Nov 2010 02:05:32 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2294#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2294#comment:5</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/2294#comment:4" title="Comment 4">anonymous</a>: </p> <blockquote class="citation"> <p> It's at <code>status/explicit-failures-markup.xml</code>. </p> </blockquote> <p> Thanks for the pointer. I see two expected failure markups for optional_test_ref, one entry for msvc-6.5 and msvc-7.1 and another for the GCC family of compilers. </p> <p> I'll add the above text in both entries and whoever will apply should do the right thing. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Dean Michael Berris</dc:creator> <pubDate>Mon, 29 Nov 2010 02:28:49 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/2294 https://svn.boost.org/trac10/ticket/2294 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-optional-explicit-failures-markup-issue2294.diff</span> </li> </ul> <p> Proposed patch including the proposed text in the issue. </p> Ticket Marshall Clow Fri, 07 Jan 2011 00:45:28 GMT <link>https://svn.boost.org/trac10/ticket/2294#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2294#comment:6</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/67743" title="Applied patch; refs #2294">[67743]</a>) Applied patch; refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2294" title="#2294: Bugs: Please improve test annotation (closed: fixed)">#2294</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Fri, 07 Jan 2011 01:02:54 GMT</pubDate> <title>owner changed https://svn.boost.org/trac10/ticket/2294#comment:7 https://svn.boost.org/trac10/ticket/2294#comment:7 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Fernando Cacciola</span> to <span class="trac-author">Marshall Clow</span> </li> </ul> Ticket Marshall Clow Sat, 08 Jan 2011 18:45:50 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/2294#comment:8 https://svn.boost.org/trac10/ticket/2294#comment:8 <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> Fix merged to release branch in <a class="changeset" href="https://svn.boost.org/trac10/changeset/67792" title="Merging fixes to release; fixes #2294 fixes #4918 fixes #3645 refs ...">[67792]</a> </p> Ticket