This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: Template base class: name lookup bug?
- From: "Kaz Kylheku" <kaz at zeugmasystems dot com>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Fri, 3 Nov 2006 16:05:38 -0800
- Subject: RE: Template base class: name lookup bug?
Kaz Kylheku wrote:
> #include <cstdio>
>
> template <class T>
> class Base {
> protected:
> int numberBase;
> };
>
> template <class T>
> class Derived : public Base<T> {
> public:
> void print()
> {
> printf("bn = %d\n", numberBase);
> }
> };
>
> int main()
> {
> Derived<int> d;
> d.print();
> return 0;
> }
New discovery: simply changing it to ``this->numberBase'' gets rid of
the error.
I forgot to mention that the latest version with which I reproduced this
is GCC 4.1.1.