From patchwork Wed Jun 15 19:58:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 636049 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 3rVHQr66rtz9t1H for ; Thu, 16 Jun 2016 05:59:16 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=umGEo816; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=K89TPK75YgMgDR7uYY1B/dmKuYy2PmOvX9xuCMwoaKWaF4x7mC mxxvei2rJU74+YbkJ+v65KB1SPZJ3tSglqvMdMqncRr3mxtnn6qZZCp2Kurxjh4f H2TzQNjC3SBdYz5wwQLyAgQNh3VOSbSD7fgD87nFsqDYSiinFlaR60Yno= 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:to:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=6LPnwfj0KYmGWAMS0P4F6syq1GA=; b=umGEo816WmfI71R6ffJI 7+IUyvhK82Sn+2+psS2WkSCDG1L84c6V1Qm0O/5YJue5xsTog/p/buFG3W1UXqrc EQuIrwXPI8xN/6c803j5uAj8Fg+5CLlDX7l8sa4ERvHrg52H23oR/b5NzsLBTpNY zyWcX/GvEv4UD7kZ9WOEFg4= Received: (qmail 129313 invoked by alias); 15 Jun 2016 19:59:08 -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 129275 invoked by uid 89); 15 Jun 2016 19:59:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=BAYES_00, KAM_ASCII_DIVIDERS, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: userp1040.oracle.com Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 15 Jun 2016 19:58:56 +0000 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u5FJwqoj017581 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 15 Jun 2016 19:58:53 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u5FJwql2011903 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 15 Jun 2016 19:58:52 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u5FJwnRD025412; Wed, 15 Jun 2016 19:58:51 GMT Received: from [192.168.1.4] (/79.23.238.165) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 15 Jun 2016 12:58:49 -0700 To: "gcc-patches@gcc.gnu.org" Cc: Jason Merrill From: Paolo Carlini Subject: [C++ Patch] Avoid a few more '+' in warnings Message-ID: <5761B377.9080904@oracle.com> Date: Wed, 15 Jun 2016 21:58:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 X-IsSubscribed: yes Hi, looks like last year I forgot to grep for %q+F and %q+#F. Tested x86_64-linux. Should be obvious... Thanks, Paolo. ////////////////////// 2016-06-15 Paolo Carlini * decl.c (wrapup_globals_for_namespace): Use DECL_SOURCE_LOCATION and "%qF" in warning_at instead of "%q+F" in warning. (check_redeclaration_exception_specification): Likewise in pedwarn (and error, inform, for consistency). * call.c (joust): Likewise. Index: call.c =================================================================== --- call.c (revision 237318) +++ call.c (working copy) @@ -9422,10 +9424,10 @@ joust (struct z_candidate *cand1, struct z_candida "default argument mismatch in " "overload resolution")) { - inform (input_location, - " candidate 1: %q+#F", cand1->fn); - inform (input_location, - " candidate 2: %q+#F", cand2->fn); + inform (DECL_SOURCE_LOCATION (cand1->fn), + " candidate 1: %q#F", cand1->fn); + inform (DECL_SOURCE_LOCATION (cand2->fn), + " candidate 2: %q#F", cand2->fn); } } else Index: decl.c =================================================================== --- decl.c (revision 237318) +++ decl.c (working copy) @@ -914,8 +914,9 @@ wrapup_globals_for_namespace (tree name_space, voi && !DECL_ARTIFICIAL (decl) && !TREE_NO_WARNING (decl)) { - warning (OPT_Wunused_function, - "%q+F declared % but never defined", decl); + warning_at (DECL_SOURCE_LOCATION (decl), + OPT_Wunused_function, + "%qF declared % but never defined", decl); TREE_NO_WARNING (decl) = 1; } } @@ -1233,18 +1234,20 @@ check_redeclaration_exception_specification (tree && !comp_except_specs (new_exceptions, old_exceptions, ce_normal)) { const char *msg - = "declaration of %q+F has a different exception specifier"; + = "declaration of %qF has a different exception specifier"; bool complained = true; + location_t new_loc = DECL_SOURCE_LOCATION (new_decl); if (DECL_IN_SYSTEM_HEADER (old_decl)) - complained = pedwarn (0, OPT_Wsystem_headers, msg, new_decl); + complained = pedwarn (new_loc, OPT_Wsystem_headers, msg, new_decl); else if (!flag_exceptions) /* We used to silently permit mismatched eh specs with -fno-exceptions, so make them a pedwarn now. */ - complained = pedwarn (0, OPT_Wpedantic, msg, new_decl); + complained = pedwarn (new_loc, OPT_Wpedantic, msg, new_decl); else - error (msg, new_decl); + error_at (new_loc, msg, new_decl); if (complained) - inform (0, "from previous declaration %q+F", old_decl); + inform (DECL_SOURCE_LOCATION (old_decl), + "from previous declaration %qF", old_decl); } }