public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gdr at integrable-solutions dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/19741] suboptimal error message for template functions (as opposed to non-templates)
Date: Tue, 01 Feb 2005 16:05:00 -0000	[thread overview]
Message-ID: <20050201160447.4325.qmail@sourceware.org> (raw)
In-Reply-To: <20050201140539.19741.eda-qa@disemia.com>


------- Additional Comments From gdr at integrable-solutions dot net  2005-02-01 16:04 -------
Subject: Re:  suboptimal error message for template functions (as opposed to non-templates)

"bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| This is in fact true. There is a mismatch between error messages for 
| template function arguments and non-templates: 
| -------------------- 
|                     void foo1(); 
| template <typename> void foo2(); 
|  
| template <typename> bool bar(void (*) () ); 
|  
| bool b1 = bar<int> (1, &foo1); 
| bool b2 = bar<int> (1, &foo2<int>); 
| -------------------- 
| g/x> /home/bangerth/bin/gcc-4.0-pre/bin/c++ -c x.cc 
| x.cc:6: error: no matching function for call to ?bar(int, void (*)())? 
| x.cc:7: error: no matching function for call to ?bar(int, <unknown type>)? 
|  
| Since the complete template arguments to foo2 are given, the type should 
| in fact be completely known. 

Agreed.

(More generally, I think the C++ front-end should have a type for
overload set and -- by means of implication for templates too -- to
better capture user mistakes.)

-- Gaby


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19741


  parent reply	other threads:[~2005-02-01 16:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-01 14:06 [Bug c++/19741] New: less than optimal error message (actually, just appears wrong, use of <unknown_type>?) eda-qa at disemia dot com
2005-02-01 14:06 ` [Bug c++/19741] " eda-qa at disemia dot com
2005-02-01 14:27 ` [Bug c++/19741] suboptimal error message for template functions (as opposed to non-templates) bangerth at dealii dot org
2005-02-01 16:05 ` gdr at integrable-solutions dot net [this message]
2005-02-01 17:30 ` bangerth at dealii dot org
     [not found] <bug-19741-3255@http.gcc.gnu.org/bugzilla/>
2005-10-04  2:32 ` pinskia at gcc dot gnu dot org
     [not found] <bug-19741-4@http.gcc.gnu.org/bugzilla/>
2012-01-20  3:16 ` pinskia at gcc dot gnu.org

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=20050201160447.4325.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).