Common V3 coding bug

Levente Farkas lfarkas@mindmaker.hu
Wed Jul 18 00:20:00 GMT 2001


Mark Mitchell wrote:
> 
> 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'. It's

why? ok I know it's not a c++ language list but IMHO the above is valid c++
code, since everything in A are public (A is a struct) and B inherit 
everything public. so what's the problem? I try to find some special
exception in the template section of the standard but I can't (which
doesn't mean there it's not). if you've got rigth I learn again 
something new:-)

 -- Levente                               "Si vis pacem para bellum!"



More information about the Libstdc++ mailing list