This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
template bug
- To: bug-gcc at gnu dot org
- Subject: template bug
- From: Erik Smith <ersmith at ucsd dot edu>
- Date: Wed, 19 Apr 2000 06:51:48 -0700
GCC version: 2.95.2
system type: red hat linux 6.0
All options you passed to the compiler: g++ -fexceptions
g++ should be able to resolve the call to the overloaded function:
Here is the code and the output:
template<class T,class S> void foo(T &t,S &s) {}
template<class T> void foo(T &t,const char *s) {}
class ABC {};
inline void foo2() {
ABC abc;
foo(abc,"test");
}
/data/product/lib2/string_util.h: In function `void foo2()':
/data/product/lib2/string_util.h:129: call of overloaded `foo (ABC &, const
char[3])' is ambiguous
/data/product/lib2/string_util.h:124: candidates are: void foo<ABC, const
char[3]>(ABC &, const char (&)[3])
/data/product/lib2/string_util.h:125: void foo<ABC>(ABC &,
const char *)