From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Archive: List-Post: List-Help: Sender: gcc-patches-owner@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 13:41:00 -0000 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 Content-Type: multipart/mixed; boundary="------------050801060000050600040401" X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00507.txt.bz2 This is a multi-part message in MIME format. --------------050801060000050600040401 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 480 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. //////////////////////// --------------050801060000050600040401 Content-Type: text/plain; charset=UTF-8; name="CL_54941" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="CL_54941" Content-length: 295 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. --------------050801060000050600040401 Content-Type: text/plain; charset=UTF-8; name="patch_54941" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch_54941" Content-length: 1226 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 "" } --------------050801060000050600040401--