From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24608 invoked by alias); 24 Dec 2014 16:59:55 -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 24567 invoked by uid 48); 24 Dec 2014 16:59:51 -0000 From: "mw_triad at users dot sourceforge.net" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/58876] No non-virtual-dtor warning in std::unique_ptr Date: Wed, 24 Dec 2014 16:59:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: mw_triad at users dot sourceforge.net X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi 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/msg02716.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58876 --- Comment #7 from Matthew Woehlke --- (In reply to Jonathan Wakely from comment #6) > (In reply to Matthew Woehlke from comment #5) > > Actually, this may be required for 'make_unique(new B)' to warn, since > > That's not how make_unique works. ...and I'm suggesting it *should* be. (How else are you going to warn? After that executes, the pointer no longer knows that it really contains a B, unless you teach the compiler some fancy extra tricks, which seems overly complicated. Conversely, I feel that 'make_unique(new B)' should warn if it's going to result in failing to call B's dtor. I might even go so far as to say 'even if the compiler can prove that B's dtor is trivial', though I'd be willing to delegate that to a different and more pedantic warning.)