This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/22596] Impossible to explicitly instantiate particular overloaded function
- From: "jason at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 22 Jun 2011 17:35:12 +0000
- Subject: [Bug c++/22596] Impossible to explicitly instantiate particular overloaded function
- Auto-submitted: auto-generated
- References: <bug-22596-4@http.gcc.gnu.org/bugzilla/>
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.