From patchwork Sun Sep 8 13:00:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 273434 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "www.sourceware.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 5446F2C0089 for ; Sun, 8 Sep 2013 23:00:32 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=aOZVANjxWGnjbhZiv+Tkm5MDYn1mji5hMrYj1XyeTa6 tCXwGXJeeLbcqJL2hOSMlSBfu5ssV4CDR08b4yU1qmXmUkDWqsfZ1LWBo0DC/rtp lbiP6NMKcBPFxwYDBf2ldnjv3CTyRCjZQgWSBnd74kVgKD1OlStqIFkr0P6ABia8 = 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 :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=bT42yI8dDOuNs+24DItKc6w5ShI=; b=e4uU/6pkGfKGvGUxP 1O50y9DMFmb7+hD4aThpqE+1xudziGZPl/Sofx1pIbPloG7gsnIYOFcnHtH93p4Q xsRg7jiylAZOUhm3iTo6k7lOJJj5Pot8g82Q33ta6nZ5sPfRqYE21PwNJZOq/b7a EZ8QjKA4KHK79PE7YyTuLEJ6Ic= Received: (qmail 11682 invoked by alias); 8 Sep 2013 13:00:24 -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 11673 invoked by uid 89); 8 Sep 2013 13:00:24 -0000 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-SHA encrypted) ESMTPS; Sun, 08 Sep 2013 13:00:24 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, RP_MATCHES_RCVD, SPF_PASS, UNPARSEABLE_RELAY autolearn=ham version=3.3.2 X-HELO: userp1040.oracle.com Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r88D0K5b006474 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 8 Sep 2013 13:00:21 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r88D0J6k027793 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 8 Sep 2013 13:00:20 GMT Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r88D0J3s001810; Sun, 8 Sep 2013 13:00:19 GMT Received: from poldo4.casa (/79.43.214.237) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 08 Sep 2013 06:00:19 -0700 Message-ID: <522C74E1.50305@oracle.com> Date: Sun, 08 Sep 2013 15:00:17 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Gabriel Dos Reis Subject: [diagnostic patch] PR 54941 X-IsSubscribed: yes Hi all, Gaby, in this bug Manuel noticed that the zeros in the diagnostic lines of the form: :0:0: .... don't provide useful information. Thus the below just avoids printing the zeros basing directly on the file name: admittedly, it may seem a bit gross, but in practice the strcmp would often fail early, and should be rather efficient anyway because the second argument is known at compile-time. Tested x86_64-linux. Thanks, Paolo. //////////////////////// 2013-09-08 Paolo Carlini PR c++/54941 * diagnostic.c (diagnostic_build_prefix): When s.file is "" don't output line and column numbers. /testsuite 2013-09-08 Paolo Carlini PR c++/54941 * g++.dg/overload/new1.C: Adjust. Index: diagnostic.c =================================================================== --- diagnostic.c (revision 202358) +++ diagnostic.c (working copy) @@ -245,6 +245,9 @@ diagnostic_build_prefix (diagnostic_context *conte (s.file == NULL ? build_message_string ("%s%s:%s %s%s%s", locus_cs, progname, locus_ce, text_cs, text, text_ce) + : !strcmp (s.file, N_("")) + ? build_message_string ("%s%s:%s %s%s%s", locus_cs, s.file, locus_ce, + text_cs, text, text_ce) : context->show_column ? build_message_string ("%s%s:%d:%d:%s %s%s%s", locus_cs, s.file, s.line, s.column, locus_ce, text_cs, text, text_ce) Index: testsuite/g++.dg/overload/new1.C =================================================================== --- testsuite/g++.dg/overload/new1.C (revision 202358) +++ testsuite/g++.dg/overload/new1.C (working copy) @@ -17,6 +17,5 @@ void f(X *x = new (3) X(6)); // { dg-error "" } void f(X *x = new (2) X[10]); // { dg-error "" } // { dg-message "candidate" "candidate note" { target *-*-* } 18 } -// { dg-message "operator new|candidate expects" "match candidate text" { target *-*-* } 00 } void f(X *x = new X[10][5]); // { dg-error "" }