Boost logo

Boost :

Subject: Re: [boost] gcc 4.4.3 + boost optional 1.40 crash
From: Gaetano Mendola (mendola_at_[hidden])
Date: 2012-11-23 03:56:49

On 11/23/2012 09:46 AM, Andrey Semashev wrote:
> On Fri, Nov 23, 2012 at 12:28 PM, Gaetano Mendola <mendola_at_[hidden]> wrote:
>> Hi all,
>> after banging my head for an entire day I come out with this
>> test case showing a possible bug in gcc 4.4.3 or in boost optional,
>> the test crashes with a pure virtual method called only if compiled
>> only with -O1, -O2, -O3.
>> The same code in another machine with gcc 4.7.2 and boost 1.49 works
>> fine.
> The only virtual function I see is B::bar so I assume that's where it
> breaks. That's only possible if the compiler messed up the second D's
> construction somehow. IMO, this is a compiler issue since optional is
> not used with D. Did you try to accept the D::foo argument by const
> reference instead of by value?

Same problem, what is puzzling me is that you can make it working doing
the following:

- Remove the noncopyable from B


- Remove one of the two segments in the extra scope in main


- Remove the try { } catch

Gaetano Mendola

Boost list run by bdawes at, gregod at, cpdaniel at, john at