From patchwork Sat Oct 8 21:35:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 118568 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id BC641B70C0 for ; Sun, 9 Oct 2011 08:37:31 +1100 (EST) Received: (qmail 17403 invoked by alias); 8 Oct 2011 21:37:29 -0000 Received: (qmail 17395 invoked by uid 22791); 8 Oct 2011 21:37:28 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from rcsinet15.oracle.com (HELO rcsinet15.oracle.com) (148.87.113.117) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 08 Oct 2011 21:37:06 +0000 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by rcsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id p98Lb3Tv004951 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 8 Oct 2011 21:37:05 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p98Lb2pB005278 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 8 Oct 2011 21:37:03 GMT Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p98LavIJ019524; Sat, 8 Oct 2011 16:36:57 -0500 Received: from [192.168.1.4] (/79.36.30.185) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 08 Oct 2011 14:36:57 -0700 Message-ID: <4E90C21E.2050908@oracle.com> Date: Sat, 08 Oct 2011 23:35:26 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110922 Thunderbird/7.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" , Jason Merrill Subject: [C++ Patch] PR 34927 (Take 2) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi again, today I had a look to clone_function_decl & co, and came up with the below. I understand DECL_DELETING_DESTRUCTOR_P would work as well... Tested x86_64-linux. Thanks, Paolo. /////////////////// 2011-10-08 Paolo Carlini PR c++/34927 * typeck2.c (abstract_virtuals_error_sfinae): Don't produce duplicate inform messages in case of cloned destructor. Index: typeck2.c =================================================================== --- typeck2.c (revision 179660) +++ typeck2.c (working copy) @@ -340,7 +340,10 @@ abstract_virtuals_error_sfinae (tree decl, tree ty type); FOR_EACH_VEC_ELT (tree, pure, ix, fn) - inform (input_location, "\t%+#D", fn); + if (! DECL_CLONED_FUNCTION_P (fn) + || DECL_COMPLETE_DESTRUCTOR_P (fn)) + inform (input_location, "\t%+#D", fn); + /* Now truncate the vector. This leaves it non-null, so we know there are pure virtuals, but empty so we don't list them out again. */