
23 Nov
2012
23 Nov
'12
8:46 a.m.
On Fri, Nov 23, 2012 at 12:28 PM, Gaetano Mendola <mendola@gmail.com> 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?