This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Bug report
- To: jbelo at isel dot pt
- Subject: Re: Bug report
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Sat, 27 May 2000 22:51:00 +0200
- CC: gcc-bugs at gcc dot gnu dot org
- References: <NDBBKFGCDKEECMHLHDNOGEOGCDAA.jbelo@isel.pt>
> 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