This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/23055] overload resolution does not find templated function
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Jul 2005 15:21:43 -0000
- Subject: [Bug c++/23055] overload resolution does not find templated function
- References: <20050725050809.23055.peter.pirkelbauer@tamu.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2005-07-25 15:21 -------
This basically boils down to this question:
---------------------
template <class> struct S { typedef int type; };
template <class T>
int foo(T, typename S<T>::type * ret);
int j = foo(1, 0);
----------------------
icc accepts this, gcc doesn't. I believe it should. The question is whether
the second of the arguments, of type int, should be converted to the
expected int*. During template deduction, no conversions are performed. I.e.
if we had declared foo as foo(T,T*), then we should reject the call. However,
the template type T is used in a non-deductible context in the second argument
of foo, so the type of T should be deduced only based on the first argument,
to type int then.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23055