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]
Other format: [Raw text]

[Bug c++/22596] Impossible to explicitly instantiate particular overloaded function


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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #9 from Jason Merrill <jason at gcc dot gnu.org> 2011-06-22 17:35:09 UTC ---
This is not a bug; under the partial ordering rules, the second foo is more
specialized than the first, so if both are possible matches the second will be
chosen.

If you want the explicit instantiation to match the same function that's called
with no explicit template arguments, then don't provide explicit template
arguments in the explicit instantiation.  If you just write

template int foo(A_class<int> a);

or

template int foo<>(A_class<int> a);

it will do what you want.


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