From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19247 invoked by alias); 14 Apr 2008 14:35:40 -0000 Received: (qmail 18586 invoked by uid 48); 14 Apr 2008 14:34:47 -0000 Date: Mon, 14 Apr 2008 14:35:00 -0000 Message-ID: <20080414143447.18584.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/35904] Poor error message In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "bangerth at dealii dot org" 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: 2008-04/txt/msg00985.txt.bz2 ------- Comment #1 from bangerth at dealii dot org 2008-04-14 14:34 ------- You are asking for too much. The problem is that in your first example the compiler knows that you want to call the grab() function and therefore can give you an informative error message. But in the second example it can't: there's a template, and the compiler tries to match your call's argument types with the template types, but it can't find a set of template types for which the call would match the signature of the function template. In other words, it doesn't know which function you want to call -- there doesn't appear to be one that would match what you want. To implement what you suggest would require the compiler to speculate what you wanted, for example by speculating that you wanted grab. We've found over the years that letting the compiler speculate sometimes produces a better diagnostic, but most of the time leads to messages that really don't have anything to do with what the user really wanted -- and then become really confusing. W. -- bangerth at dealii dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bangerth at dealii dot org Status|UNCONFIRMED |RESOLVED Resolution| |WONTFIX http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35904