[Bug c++/22596] Impossible to explicitly instantiate particular overloaded function
jason at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jun 22 17:35:00 GMT 2011
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.
More information about the Gcc-bugs
mailing list