This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

template bug


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 *)




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]