public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/57510] initializer_list memory leak Date: Mon, 03 Jun 2013 13:09:00 -0000 [thread overview] Message-ID: <bug-57510-4-drsFJSvSsG@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-57510-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57510 Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2013-06-03 Ever confirmed|0 |1 --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- Testcase without <memory and <random> and not requiring valgrind: #include <initializer_list> struct counter { static int n; counter() { ++n; } counter(const counter&) { ++n; } ~counter() { --n; } }; int counter::n = 0; struct X { X () { if (counter::n > 1) throw 1; } counter c; }; int main () { try { auto x = { X{}, X{} }; } catch (...) { if ( counter::n != 0 ) throw; } }
next prev parent reply other threads:[~2013-06-03 13:09 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-06-03 12:23 [Bug c++/57510] New: " matt at ookypooky dot com 2013-06-03 13:09 ` redi at gcc dot gnu.org [this message] 2013-06-03 14:28 ` [Bug c++/57510] " paolo.carlini at oracle dot com 2013-07-22 10:42 ` redi at gcc dot gnu.org 2014-12-08 21:03 ` tavianator at gmail dot com 2014-12-10 22:25 ` jason at gcc dot gnu.org 2014-12-12 3:49 ` jason at gcc dot gnu.org 2014-12-12 3:58 ` jason at gcc dot gnu.org 2015-01-23 16:31 ` jason at gcc dot gnu.org 2020-03-10 20:10 ` [Bug c++/57510] subobjects not destroyed when exception thrown during list-initialization jason 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-57510-4-drsFJSvSsG@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).