From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8184 invoked by alias); 13 Apr 2012 11:56:06 -0000 Received: (qmail 8175 invoked by uid 22791); 13 Apr 2012 11:56:05 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 13 Apr 2012 11:55:52 +0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/24985] caret diagnostics Date: Fri, 13 Apr 2012 11:56:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: manu at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-04/txt/msg01001.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D24985 --- Comment #39 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez 2012-04-13 11:54:53 UTC --- (In reply to comment #36) > Sounds good to me. But I think GNU conventions require a location here? Well, if that is a hard requirement, I can just suppress the caret. Or we c= an just not print the "note: candidates are:". It seems superfluous info to me. > > > t.C:1:6: note: candidate expects 0 arguments, 1 provided > > > void f(); void f(int,int); > > > ^ > > > t.C:1:17: note: void f(int, int) > > > void f(); void f(int,int); > > > ^ > > >=20 > > > and the 2nd note here looks wrong. > >=20 > > Could you explain why? >=20 > Because void f(int, int) is not of type "candidate expects 0 arguments" b= ut > it is of expects two which is duplicate of the following >=20 > t.C:1:17: note: candidate expects 2 arguments, 1 provided > void f(); void f(int,int); > ^ >=20 > But that's of course a different bug. I see. The problem is that the output is meant to be read as (locations and duplicated carets removed for clarity): note: candidates are: note: candidate #1 is void f() void f(); void f(int,int); ^ note: candidate #1 expects 0 arguments, 1 provided note: candidate #2 is void f(int, int) void f(); void f(int,int); ^ note: candidate #2 expects 2 arguments, 1 provided that is, first print the candidate, then the reason for failure. If you read again the original, the 2nd and 3rd notes go together, like the 4th and 5th= , so the output is correct (although I agree that quite confusing). That is why I proposed: note: candidate 'void f()' expects 0 arguments, 1 provided void f(); void f(int,int); ^ note: candidate 'void f(int, int)' expects 2 arguments, 1 provided void f(); void f(int,int); ^ (that is, instead of two notes per candidate, just one). Or we could number= the candidates like above.