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: "phenning at lanl dot gov" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jul 2005 23:26:44 -0000
- Subject: [Bug c++/22596] Impossible to explicitly instantiate particular overloaded function
- References: <20050721184642.22596.phenning@lanl.gov>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From phenning at lanl dot gov 2005-07-21 23:26 -------
(In reply to comment #5)
> Your explicit instantiation
> template int foo< A_class<int> >(A_class<int> a);
> obviously matches both the declarations of foo. I'm unsure which
> one the compiler should choose, but if you want to instantiate the
> second one, why don't you write
> template int foo< A_class<int>,int >(A_class<int> a);
> i.e. explicitly state the second template argument as well?
The compiler is more than happy to instantiate the second one... the problem is that it is converting my
one template parameter explicit specialization into the two template parameter form, presumably
because the function signature matches. I would expect that if I explicitly state the one parameter
form, the compiler should instantiate the one parameter form.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22596