Bug report
Martin v. Loewis
martin@loewis.home.cs.tu-berlin.de
Sat May 27 13:57:00 GMT 2000
> the code:
>
> template<class T>
> void g(T t)
> {
> dd++;
> }
>
> compiles ok with gcc, but is ill-formed (Line "dd++;"), according to the C++
> definition (ISO/IEC 14882:1998(E), page 260).
Thanks for your bug report. This is a known problem; g++ does not
properly distinguish between dependant and non-dependant
names. Instead, lookup of object names is delayed until instantiation
time.
> Isn't the code:
>
> struct X
> {
> void h();
> };
>
> template<class T>
> struct Y : public T
> {
> void f() { h(); }
> };
>
> ill-formed too?
Sure. It is accepted for the same reason.
Regards,
Martin
More information about the Gcc-bugs
mailing list