template buglet?

Carlo Wood carlo@runaway.xs4all.nl
Fri Sep 4 01:43: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?

Hmm, I'd think so too.  This seems related to a bug report I posted
earlier.  There is some relation with http://www.cygnus.com/ml/egcs/1998-Aug/0162.html
I think.  I am very interested in what the guru's have to say about this
(new) test case :).

-- 
 Carlo Wood  <carlo@runaway.xs4all.nl>



More information about the Gcc mailing list