template buglet?

nbecker@fred.net nbecker@fred.net
Thu Sep 3 07:13:00 GMT 1998


egcs-1.1a:

template<class T>
void Go (const T& first, const T& last);

main() {
   char buf[256];
   Go (&buf[0], buf+strlen(buf));
   Go (buf, buf+strlen(buf));
}

g++ -g -c bug.cc
bug.cc: In function `int main()':
bug.cc:6: no matching function for call to `Go (char[256], char *)'

The second call to Go() fails.  Shouldn't the trivial conversion of
char[] -> char* have been tried?



More information about the Gcc mailing list