public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "richard-gccbugzilla at metafoo dot co.uk" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/59056] ambiguous call to function template overloads not diagnosed
Date: Thu, 14 Nov 2013 03:04:00 -0000	[thread overview]
Message-ID: <bug-59056-4-nNyY7on2LC@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-59056-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 from Richard Smith <richard-gccbugzilla at metafoo dot co.uk> ---
(In reply to Walter Mascarenhas from comment #7)
> In itself, Richard's paragraph "Morally, the function should ambiguous... "
> implies that the code below is ambiguous. However, it
> compiles just fine with gcc 4.8.1, because gcc also takes into
> account the information  that check< Foo<int> >() is false
> in order to discard the specialization with the enable_if. In
> other words, the X in check<X> is not completely arbitrary,
> it my be related to Foo<T>.

GCC can't instantiate check<Ty> with a dependent type Ty, because that's not a
meaningful thing to do. And it's not allowed to use Foo<int>, because partial
ordering of templates does not depend on the actual deduced arguments for the
template specialization (it orders the templates themselves, not their
specializations). Also, the only available definition of check always returns
true. So I really don't see how that could be the case.


  parent reply	other threads:[~2013-11-14  3:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-08 22:19 [Bug c++/59056] New: enable_if turns a non-ambiguous template into an ambiguous one walter.mascarenhas at gmail dot com
2013-11-08 22:35 ` [Bug c++/59056] " paolo.carlini at oracle dot com
2013-11-09 12:58 ` redi at gcc dot gnu.org
2013-11-11 11:37 ` redi at gcc dot gnu.org
2013-11-13 11:11 ` paolo.carlini at oracle dot com
2013-11-13 21:00 ` richard-gccbugzilla at metafoo dot co.uk
2013-11-13 23:16 ` [Bug c++/59056] ambiguous call to function templates overloads not diagnosed redi at gcc dot gnu.org
2013-11-14  2:26 ` [Bug c++/59056] ambiguous call to function template " walter.mascarenhas at gmail dot com
2013-11-14  3:04 ` richard-gccbugzilla at metafoo dot co.uk [this message]
2013-11-14 10:20 ` walter.mascarenhas at gmail 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=bug-59056-4-nNyY7on2LC@http.gcc.gnu.org/bugzilla/ \
    --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).