public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "felix at fontein dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/61143] Arithmetic exception on emplacing into unordered_map moved out
Date: Sun, 11 May 2014 07:30:00 -0000	[thread overview]
Message-ID: <bug-61143-4-QH4VTdTwPm@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61143-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #1 from Felix Fontein <felix at fontein dot de> ---
Changing the example by adding a.clear() before the second emplace does not
improve the situation:

#include <unordered_map>

int main()
{
    std::unordered_map<int, int> a;
    a.emplace(1, 1);
    std::unordered_map<int, int> b = std::move(a);
    a.clear();
    a.emplace(1, 1); // floating point exception
}

>From my understanding of the standard (and from the discussion here:
http://stackoverflow.com/questions/9168823/reusing-a-moved-container) both
examples should not result in a crash.


  reply	other threads:[~2014-05-11  7:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-10 23:46 [Bug libstdc++/61143] New: " felix at fontein dot de
2014-05-11  7:30 ` felix at fontein dot de [this message]
2014-05-11 10:03 ` [Bug libstdc++/61143] [4.9/4.10 Regression] " redi at gcc dot gnu.org
2014-05-11 11:02 ` daniel.kruegler at googlemail dot com
2014-05-11 14:06 ` redi at gcc dot gnu.org
2014-05-12  6:43 ` fdumont at gcc dot gnu.org
2014-05-12 10:01 ` redi at gcc dot gnu.org
2014-05-12 10:07 ` glisse at gcc dot gnu.org
2014-05-13  9:19 ` redi at gcc dot gnu.org
2014-05-13  9:32 ` redi at gcc dot gnu.org
2014-05-13 15:26 ` felix at fontein dot de
2014-05-13 20:14 ` fdumont at gcc dot gnu.org
2014-05-13 20:48 ` redi at gcc dot gnu.org
2014-05-21 19:51 ` fdumont at gcc dot gnu.org
2014-05-23 19:35 ` fdumont 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-61143-4-QH4VTdTwPm@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: link
Be 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).