From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22585 invoked by alias); 13 Apr 2012 12:24:52 -0000 Received: (qmail 22574 invoked by uid 22791); 13 Apr 2012 12:24:49 -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 12:24:36 +0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/24985] caret diagnostics Date: Fri, 13 Apr 2012 12:24: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: redi 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" 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/msg01012.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24985 --- Comment #45 from Jonathan Wakely 2012-04-13 12:24:30 UTC --- (In reply to comment #42) > Yes, I like that, too. For reference, the following: > > 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); > ^ I like this for this example, but does it work as well if the function name is very long, and the "expects 2 arguments, 1 provided" is no longer in a predictable position, but pushed off to the right of a very long line? t.cc: In function 'int main()': t.cc:10:25: error: no matching function for call to 'a_long_function_name(int)' t.cc:10:25: note: candidates are: t.cc:5:6: note: void a_long_function_name() t.cc:5:6: note: candidate expects 0 arguments, 1 provided t.cc:6:6: note: void a_long_function_name(something_verbose::my_very_long_type, something_verbose::my_very_long_type) t.cc:6:6: note: candidate expects 2 arguments, 1 provided would become t.cc: In function 'int main()': t.cc:10:25: error: no matching function for call to 'a_long_function_name(int)' a_long_function_name(1); ^ t.cc:10:25: note: candidates are: t.cc:5:6: note: candidate 'void a_long_function_name()' expects 0 arguments, 1 provided void a_long_function_name(); ^ t.cc:6:6: note: candidate 'void a_long_function_name(something_verbose::my_very_long_type, something_verbose::my_very_long_type)' expects 2 arguments, 1 provided void a_long_function_name(something_verbose::my_very_long_type, something_verbose::my_very_long_type); ^ (we do already have this problem when printing ridiculous paths for stdlib headers with superfluous lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../.. rubbish in them, is there an existing bug for that?)