From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17344 invoked by alias); 3 Nov 2014 12:57:22 -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 17324 invoked by uid 48); 3 Nov 2014 12:57:18 -0000 From: "petschy at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/63657] [4.9/5 regression] -Wunused-variable: warning supressed by virtual dtor Date: Mon, 03 Nov 2014 12:57: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.9.1 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: petschy at gmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.3 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-11/txt/msg00117.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63657 --- Comment #4 from petschy at gmail dot com --- Sorry, but this is definitely not the same issue. Bug 38958 is about returning by value and binding to a reference. This issue is about returning a REFERENCE and binding it to a reference. No class ctor/dtor/copy is involved, references are just syntactic sugar on pointers: a single pointer is returned and stored locally. This is 100% sure, since in the production code the bug appeared with a singleton which is not constructible/destructible/copyable to the outside world. Please reopen the issue.