This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: A problem of template implicit instantiation


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]