From patchwork Fri Apr 4 12:01:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Fabien_Ch=C3=AAne?= X-Patchwork-Id: 336935 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2DDB1140092 for ; Fri, 4 Apr 2014 23:02:00 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:cc:content-type; q=dns; s=default; b=ByW7tDabZD+YrJCiQIbYcY7Px8kNrzW0spd9Mgsv8Ea F3JGTqTiBPfDvgtgQsmNf0xoZYk7CZbFDOaLVjV+98yDpY6xzDHd3ohL/621nQUU FRAV0DwNoANAFWP6X/dILO58WVheG+14GFTuI48BneTbX4nZ3J8KhnXwQwoukJN0 = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:cc:content-type; s=default; bh=YmXDU3lV+eSfr9UJYngZtnSR4r0=; b=eR86yvBi590KYb4ee KIcwRKq9vsEgKc5QqucPcF0QXMiyjPGuWy0nBuG0Yv4NXCDX096ls65xGEdlB+AQ K9rX75l6+HPygjXyyEFJ12+2TI2keo/0aTLNPHfB1jx80RNrGkyIDcwxxPykruMH LAQeYv/6gm0/bFLFQln4F+nZwc= Received: (qmail 9342 invoked by alias); 4 Apr 2014 12:01:54 -0000 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 Received: (qmail 9333 invoked by uid 89); 4 Apr 2014 12:01:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ve0-f181.google.com Received: from mail-ve0-f181.google.com (HELO mail-ve0-f181.google.com) (209.85.128.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 04 Apr 2014 12:01:52 +0000 Received: by mail-ve0-f181.google.com with SMTP id oy12so1327872veb.40 for ; Fri, 04 Apr 2014 05:01:50 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.220.4.132 with SMTP id 4mr2974150vcr.9.1396612910173; Fri, 04 Apr 2014 05:01:50 -0700 (PDT) Received: by 10.52.103.105 with HTTP; Fri, 4 Apr 2014 05:01:49 -0700 (PDT) Date: Fri, 4 Apr 2014 14:01:49 +0200 Message-ID: Subject: conditional notes after 'warning' From: =?ISO-8859-1?Q?Fabien_Ch=EAne?= To: Jason Merrill Cc: GCC Patches X-IsSubscribed: yes Hi, Following the previous patchlet about conditional notes after 'permerror', same cleanup with 'warning'. Tested x86_64 linux without regressions. OK to commit ? cp/ChangeLog 2014-04-04 Fabien ChĂȘne * class.c (find_abi_tags_r): Check for the return of warning before emitting a note. (one_inherited_ctor): Likewise. Index: gcc/cp/class.c =================================================================== --- gcc/cp/class.c (rĂ©vision 209070) +++ gcc/cp/class.c (copie de travail) @@ -1385,19 +1385,21 @@ find_abi_tags_r (tree *tp, int *walk_sub /* Otherwise we're diagnosing missing tags. */ else if (TYPE_P (p->subob)) { - warning (OPT_Wabi_tag, "%qT does not have the %E abi tag " - "that base %qT has", p->t, tag, p->subob); - inform (location_of (p->subob), "%qT declared here", - p->subob); + if (warning (OPT_Wabi_tag, "%qT does not have the %E abi tag " + "that base %qT has", p->t, tag, p->subob)) + inform (location_of (p->subob), "%qT declared here", + p->subob); } else { - warning (OPT_Wabi_tag, "%qT does not have the %E abi tag " - "that %qT (used in the type of %qD) has", - p->t, tag, *tp, p->subob); - inform (location_of (p->subob), "%qD declared here", - p->subob); - inform (location_of (*tp), "%qT declared here", *tp); + if (warning (OPT_Wabi_tag, "%qT does not have the %E abi tag " + "that %qT (used in the type of %qD) has", + p->t, tag, *tp, p->subob)) + { + inform (location_of (p->subob), "%qD declared here", + p->subob); + inform (location_of (*tp), "%qT declared here", *tp); + } } } } @@ -3083,9 +3085,9 @@ one_inherited_ctor (tree ctor, tree t) one_inheriting_sig (t, ctor, new_parms, i); if (parms == NULL_TREE) { - warning (OPT_Winherited_variadic_ctor, - "the ellipsis in %qD is not inherited", ctor); - inform (DECL_SOURCE_LOCATION (ctor), "%qD declared here", ctor); + if (warning (OPT_Winherited_variadic_ctor, + "the ellipsis in %qD is not inherited", ctor)) + inform (DECL_SOURCE_LOCATION (ctor), "%qD declared here", ctor); } }