Common V3 coding bug
Gabriel Dos Reis
gdr@codesourcery.com
Wed Jul 18 06:26:00 GMT 2001
Mark Mitchell <mark@codesourcery.com> writes:
| The new parser is fun because so far I've coded very little in the
| way of language extensions. That's partly because I hope to argue
| about them before implementing them, and partly because it gives me a way
| of shaking out little bugs in V3. :-)
|
| There are a bunch of places in the code where V3 does:
|
| template <class T> struct A {
| int i;
| };
|
| template <class T> struct B : public A<T> {
| void f() { i = 3; }
| };
|
| This isn't valid C++; there's no `i' in scope in `B'. You have
| to add `using A<T>::i;' if you want to do this, or write `B<T>::i'.
Or just say
this->i = 3;
| (Yes, the new parser is doing something similar to two-phase name
| lookup, so it gets this mostly right.)
Thanks a lot, Mark.
-- Gaby
More information about the Libstdc++
mailing list