public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "manu at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/40793] "Error: no matching function for call to XYZ" doesn't display function-template-arguments
Date: Thu, 01 Jul 2010 21:31:00 -0000	[thread overview]
Message-ID: <20100701213106.23067.qmail@sourceware.org> (raw)
In-Reply-To: <bug-40793-17961@http.gcc.gnu.org/bugzilla/>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1643 bytes --]



------- 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<double,
"text">()’
pr40793.C:2:18: note: candidate is: template<class T, T t> 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


  parent reply	other threads:[~2010-07-01 21:31 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-17 22:09 [Bug c++/40793] New: " jonathan dot sd24 at yahoo dot de
2009-07-18  8:59 ` [Bug c++/40793] " rguenth at gcc dot gnu dot org
2009-07-18 10:02 ` jonathan dot sd24 at yahoo dot de
2009-07-21 17:46 ` jwakely dot gcc at gmail dot com
2009-07-29 21:05 ` jonathan dot sd24 at yahoo dot de
2009-08-25 14:25 ` bangerth at gmail dot com
2010-07-01  8:58 ` m-matti-a dot lehtonen at iki dot fi
2010-07-01 21:31 ` manu at gcc dot gnu dot org [this message]
2010-07-01 21:38 ` bangerth at gmail dot com
     [not found] <bug-40793-4@http.gcc.gnu.org/bugzilla/>
2010-11-30 23:59 ` pinskia at gcc dot gnu.org
2010-12-01  0:14 ` manu at gcc dot gnu.org
2011-03-23 16:46 ` jonathan.sd24 at yahoo dot de
2011-03-23 17:40 ` manu at gcc dot gnu.org
2011-09-29 10:56 ` paolo.carlini at oracle dot com
2011-09-29 10:59 ` paolo.carlini at oracle dot com
2011-09-29 12:17 ` manu at gcc dot gnu.org
2011-09-29 12:28 ` paolo.carlini at oracle dot com
2011-09-29 14:53 ` manu at gcc dot gnu.org
2011-09-29 15:12 ` paolo.carlini at oracle dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100701213106.23067.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).