Re: [Boost-bugs] [Boost C++ Libraries] #1301: copy-initialization from const-qualified object doesn't work

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #1301: copy-initialization from const-qualified object doesn't work
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2007-11-06 22:07:49


#1301: copy-initialization from const-qualified object doesn't work
----------------------------------------------------+-----------------------
  Reporter: Shunsuke Sogame <pstade.mb_at_[hidden]> | Owner: fcacciola
      Type: Bugs | Status: closed
 Milestone: Boost 1.35.0 | Component: optional
   Version: Boost 1.34.1 | Severity: Problem
Resolution: wontfix | Keywords:
----------------------------------------------------+-----------------------
Changes (by fcacciola):

  * status: assigned => closed
  * resolution: => wontfix

Comment:

 Replying to [comment:2 Shunsuke Sogame <pstade.mb_at_[hidden]>]:
> Replying to [comment:1 fcacciola]:
> > I think it's a gcc bug.
> > In any case I added the missing test case to see how other compilers
 handle it.
>
> Thanks for adding a test into optional_test_ref.cpp.

 :) BTW, I noticed that you have updated a test case only when I replied to
 the ticket, '''after''' I already added my own test case.

> BTW,
> `optional<int const&> orci2 = ci ;`
> is a typo of
> `optional<int const&> orci2(ci) ;` ?

 Oops, of course.

 BTW. I confimed this is a gcc bug as this simple program shows it:



 struct crw
 {
   crw ( int const& _cref ) : cref(_cref) {}

   int const& cref ;
 } ;

 int main( int, char* [] )
 {
   int const ci = 0 ;
   crw copy_init(ci);
   assert( &copy_init.cref == &ci ) ;

   crw direct_init = ci ;
   assert( &direct_init.cref == &ci ) ; // This one fails here
 }

 I'm marking the new failures as expected.

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1301#comment:3>
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:56 UTC