This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/23055] New: overload resolution does not find templated function
- From: "peter dot pirkelbauer at tamu dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Jul 2005 05:08:12 -0000
- Subject: [Bug c++/23055] New: overload resolution does not find templated function
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
I believe that the call to foo in line 35 should resolve to the function defined
in line 28/29.
# 1 "gnubug.cc"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "gnubug.cc"
# 1 "/local/lib/gcc/i686-pc-linux-gnu/4.0.0/include/stddef.h" 1 3 4
# 152 "/local/lib/gcc/i686-pc-linux-gnu/4.0.0/include/stddef.h" 3 4
typedef int ptrdiff_t;
# 214 "/local/lib/gcc/i686-pc-linux-gnu/4.0.0/include/stddef.h" 3 4
typedef unsigned int size_t;
# 2 "gnubug.cc" 2
class A {};
template <class X> struct default_return_type
{ typedef void type;
};
template <>
struct default_return_type<A>
{ typedef int type;
};
template <template <class> class RetType>
struct Base
{
typedef typename RetType<A>::type surrogate_t;
template <class T>
void foo(T&, typename RetType<T>::type * ret) {} // line 29
void foo1(A&, surrogate_t * ret) {}
};
struct Concrete : Base<default_return_type>
{ void bar(A& a) { foo(a, __null); } // line 35
void bar0(A& a) { int * x = __null; foo(a, x); }
void bar1(A& a) { foo1(a, __null); }
};
--
Summary: overload resolution does not find templated function
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: peter dot pirkelbauer at tamu dot edu
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23055