From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30784 invoked by alias); 8 Dec 2014 21:03:36 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 30736 invoked by uid 48); 8 Dec 2014 21:03:31 -0000 From: "tavianator at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/57510] initializer_list memory leak Date: Mon, 08 Dec 2014 21:03:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.7.2 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: tavianator at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-12/txt/msg00811.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57510 --- Comment #4 from Tavian Barnes --- I have a testing tool that automatically inserts operator new failures, to help test exception safety and check for leaks. This bug causes all kinds of spurious failures that I have to work around, since anything like this vector vec = {"some", "strings"}; leaks memory if the second string constructor fails. Usually it can be worked around like this string arr[] = {"some", "strings"}; but it's still quite annoying. If someone can point me in the right direction or give an outline of how to fix this bug, I'm happy to try and write up a patch myself. Thanks!