From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23135 invoked by alias); 1 Jul 2010 21:31:16 -0000 Received: (qmail 23068 invoked by uid 48); 1 Jul 2010 21:31:06 -0000 Date: Thu, 01 Jul 2010 21:31:00 -0000 Message-ID: <20100701213106.23067.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/40793] "Error: no matching function for call to XYZ" doesn't display function-template-arguments In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "manu at gcc dot gnu 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: 2010-07/txt/msg00130.txt.bz2 ------- Comment #7 from manu at gcc dot gnu dot org 2010-07-01 21:31 ------- With the patch below, we print this: pr40793.C:5:31: error: no matching function for call to ‘staticPrint()’ pr40793.C:2:18: note: candidate is: template void staticPrint() but I am not sure if it is possible to print the type of "text". Any ideas? Index: call.c =================================================================== --- call.c (revision 161658) +++ call.c (working copy) @@ -3247,12 +3247,19 @@ build_new_function_call (tree fn, VEC(tr { if (!any_viable_p && candidates && ! candidates->next && (TREE_CODE (candidates->fn) == FUNCTION_DECL)) return cp_build_function_call_vec (candidates->fn, args, complain); if (TREE_CODE (fn) == TEMPLATE_ID_EXPR) - fn = TREE_OPERAND (fn, 0); - if (!any_viable_p) + { + if (!any_viable_p) + error ("no matching function for call to %<%E(%A)%>", + fn, build_tree_list_vec (*args)); + else + error ("call of overloaded %<%E(%A)%> is ambiguous", + fn, build_tree_list_vec (*args)); + } + else if (!any_viable_p) error ("no matching function for call to %<%D(%A)%>", DECL_NAME (OVL_CURRENT (fn)), build_tree_list_vec (*args)); else error ("call of overloaded %<%D(%A)%> is ambiguous", DECL_NAME (OVL_CURRENT (fn)), build_tree_list_vec (*args)); -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40793