Re: [Boost-bugs] [Boost C++ Libraries] #2294: Please improve test annotation

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2294: Please improve test annotation
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-09-08 14:43:33


#2294: Please improve test annotation
---------------------------+------------------------------------------------
  Reporter: dave | Owner: fcacciola
      Type: Bugs | Status: new
 Milestone: Boost 1.37.0 | Component: optional
   Version: Boost 1.35.0 | Severity: Problem
Resolution: | Keywords:
---------------------------+------------------------------------------------

Comment(by dave):

 Suggested new text:

    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.

    Specifics: the following simple test fails when it should succeed.
     {{{
  #include <cassert>

 int const x = 0;
 struct A
 {
    A(int const& y)
    {
        assert(&x == &y);
    }
 };

 int main()
 {
    A a(x); // direct initialization works fine
    A b = x; // copy initialization causes x to be copied before it is
 bound
 }
     }}}

    The possible safety enhancement would be to cause the constructor in
 question
    to be explicit for optional<T const&>; that would prevent copy
 initialization.

-- 
Ticket URL: <http://svn.boost.org/trac/boost/ticket/2294#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:58 UTC