[Bug c++/24680] Invalid template code accepted
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Sat Nov 5 02:49:00 GMT 2005
------- Comment #14 from pinskia at gcc dot gnu dot org 2005-11-05 02:49 -------
(In reply to comment #13)
> The error which EDG front-end gives:
> "ComeauTest.c", line 33: error: a reference of type "int &" (not
> const-qualified)
> cannot be initialized with a value of type "double"
> resize(d->size);
> ^
> detected during instantiation of
> "List<T> &List<T>::fill(const T &, int) [with T=int]"
> 1 error detected in the compilation of "ComeauTest.c".
The other reason why this does not make sense is that EDG/Comeau is saying that
the type of d->size is always int but when instantiate List<T>::fill, the
front-end sees that it is not an int and then errors out.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24680
More information about the Gcc-bugs
mailing list