From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4209 invoked by alias); 23 Oct 2011 02:04:54 -0000 Received: (qmail 4175 invoked by uid 22791); 23 Oct 2011 02:04:46 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 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; Sun, 23 Oct 2011 02:04:31 +0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/42356] improve list of candidates and error recovery for ambiguous call Date: Sun, 23 Oct 2011 02:04: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: 2011-10/txt/msg02341.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42356 --- Comment #18 from Jonathan Wakely 2011-10-23 02:03:41 UTC --- (In reply to comment #12) > Manual said: > g++ could also specify which ones are viable candidates, and which ones are not > even viable, and for the ones not viable, explain why. None of the functions are viable, because 'newNode' is ambiguous. So your suggestion seems to be: request for member is ambiguous Overload 1: not viable, reason: ambiguous. Overload 2: not viable, reason: ambiguous. Overload 3: not viable, reason: ambiguous. Overload 4: not viable, reason: ambiguous. Overload 5: not viable, reason: ambiguous. Overload 6: not viable, reason: ambiguous. rather than what we have now: request for member is ambiguous Overload 1 Overload 2 Overload 3 Overload 4 Overload 5 Overload 6 [unhelpful nonsense about expected primary expression] I think the second one is better (apart from the primary expression part) Or maybe you could have: request for member is ambiguous Overload 1: not viable, reason: ambiguous. Overload 2: not viable, reason: ambiguous. Overload 3: not viable, reason: ambiguous, and wrong number of args Overload 4: not viable, reason: ambiguous, and wrong number of args Overload 5: not viable, reason: ambiguous, and wrong number of args Overload 6: not viable, reason: ambiguous, and wrong number of args I don't think that helps - changing the number of arguments wouldn't make the testcase compile. Resolving the ambiguous lookup would.