This is the mail archive of the gcc-bugs@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]

Re: Possible problem with template selection


> I *think* this is incorrect behaviour, since the compiler should
> pick the most specific possible version of a function, which for
> Field*Field multiplication should be option 1.

Thanks for your bug report. This is not a bug in the compiler, but in
your code. To determine which of the template functions needs to be
invoked, the compiler must perform template argument deduction for all
three of them, and then select one by overload resolution. After
deducing the template arguments for each one, it needs to instantiate
the signature of the template, i.e. parameters and return
types. Instantiating the signature fails, because there is an error in
the return type.

If you question this line of reasoning, please discuss it in one of
the public C++ fora first, eg. comp.lang.c++.moderated, or
comp.std.c++.

Regards,
Martin

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