public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rob.desbois at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/60367] Default argument object is not getting constructed Date: Mon, 03 Mar 2014 10:32:00 -0000 [thread overview] Message-ID: <bug-60367-4-g03zPupheD@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-60367-4@http.gcc.gnu.org/bugzilla/> 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.
next prev parent reply other threads:[~2014-03-03 10:32 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-02-28 17:30 [Bug c++/60367] New: " rob.desbois at gmail dot com 2014-03-02 15:14 ` [Bug c++/60367] " rob.desbois at gmail dot com 2014-03-02 22:24 ` rob.desbois at gmail dot com 2014-03-03 10:32 ` rob.desbois at gmail dot com [this message] 2014-03-03 11:20 ` rob.desbois at gmail dot com 2014-03-04 11:20 ` redi at gcc dot gnu.org 2014-03-04 11:20 ` redi at gcc dot gnu.org 2014-03-10 19:23 ` jason at gcc dot gnu.org 2014-03-11 21:08 ` reichelt at gcc dot gnu.org 2014-05-13 16:05 ` jason at gcc dot gnu.org 2014-05-13 16:06 ` jason at gcc dot gnu.org 2014-07-08 17:33 ` redi at gcc dot gnu.org 2015-03-03 18:13 ` vhaisman at gmail dot com 2015-03-03 18:15 ` redi at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-60367-4-g03zPupheD@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).