public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Yu Sheng Oh <humbleoh@gmail.com>
Cc: gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: A problem of template implicit instantiation
Date: Fri, 05 Dec 2014 15:19:00 -0000	[thread overview]
Message-ID: <CAH6eHdQdi4en4dTx6_5KyoNAiLPpyfCixHgej6dS0gqY_8cWZQ@mail.gmail.com> (raw)
In-Reply-To: <CAL3UPOcxkAthPLJyCFLo4J9WtMJxs-=X3OzZaF0yS5urjqpjmQ@mail.gmail.com>

On 5 December 2014 at 02:31, Yu Sheng Oh wrote:
> HI,
>
> I have a piece of code at http://goo.gl/r2ySE6
>
> Refer to the code, with option of "-O2 -std=c++1y", when we comment
> out the statement "id<int>;" clang-3.4.1 compiles the code
> successfully, but g++-4.9.0 compiles failed, where g++ complains that
> "unresolved overloaded function type", which in turn implies that at
> the point of calling compose function, id<int> is not instantiated.

It does seem to be a bug, but I don't think the problem is that the
function isn't instantiated.

I think the compiler is failing to deduce the return type of id<int>,
because it works if you change it to not use "auto" as the return
type.

I've reported it to Bugzilla as
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59912 with a simpler
example, thanks for reporting it to us.

  reply	other threads:[~2014-12-05 15:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-05  2:31 Yu Sheng Oh
2014-12-05 15:19 ` Jonathan Wakely [this message]
2014-12-05 15:51   ` Yu Sheng Oh
2014-12-05 17:04     ` Jonathan Wakely

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=CAH6eHdQdi4en4dTx6_5KyoNAiLPpyfCixHgej6dS0gqY_8cWZQ@mail.gmail.com \
    --to=jwakely.gcc@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=humbleoh@gmail.com \
    /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).