http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60367

--- Comment #4 from rob.desbois at gmail dot com ---
The problem only seems to occur when using the pattern "= {}" to default the
parameter; "= foo{}" and "= foo()" don't seem to provoke the differing
addresses.

I have confirmed that member data set in the default constructor seems to be
correct in the temporary despite it being at an 'unconstructed' address. The
address of the 'unconstructed' temporary is consistently the size of the
nearest whole word to sizeof(foo) below the actually-constructed address, so it
seems the address isn't just random but possibly correct in itself.

It seems that the copy/move constructor has been replaced by a memcpy(), thus
losing the side-effects. I didn't state earlier but should confirm: this occurs
with "-O0" turning off optimizations.

Behaviour with clang (3.3 final) is as expected.

Reply via email to