This is the mail archive of the
mailing list for the GCC project.
Re: deriving template classes: gcc 3.4 complains
On Oct 1, 2003, at 11:51 AM, Gerald Pfeifer wrote:
On Wed, 1 Oct 2003, Joachim Schoeberl wrote:
test34.cpp: In constructor `derived<A>::derived(int)':
test34.cpp:14: error: `i' undeclared (first use this function)
test34.cpp:14: error: (Each undeclared identifier is reported only
for each function it appears in.)
Is there something wrong with my code ?
I believe the third item under C++ at
might be relevant here.
For more information, possibly more than you want, see section 9.4.2,
"Dependent Base Classes", of Vandevoorde and Josuttis's book _C++
Templates: The Complete Guide_.
This behavior is a fairly straightforward consequence of C++'s name
lookup rules. (Of course, I also have to admit that I didn't realize
this was a consequence of those rules until I started using a compiler
that actually enforced them. I think HP's compiler may have been the