This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Templates Problem comes from gcc


> The bug that I reported in the last mail has the following origin:

Thanks for your bug report. I believe this is not a bug in gcc, but in
your code. In C++, the members of a base class which is a template are
not found during nondependent name look (nb is not a dependent name),
so nb is bound to the global variable.

If you want to refer to the variable from the base class, you must
write that as foo1<T>::nb.

Hope this helps,
Martin

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]