From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0rc2) Gecko/20020510 Description of problem: Since the typedef in class Base is private, Base<T>::TT should be inaccessible from class Derived. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1.g++ -W -Wall main.cpp -o main 2../main 3. Actual Results: Compiles and runs. Expected Results: Should not compile. Additional info: #include <list> #include <string> template<typename T> class Base { typedef T TT; }; template<typename T> class Derived : public Base<T> { public: typedef typename Base<T>::TT TT; void f() { std::list<TT> l; } }; int main(void) { Derived<std::string>().f(); return 0; }
You can close this bug report since gcc 3.3.x in Fedora handles the above code correctly.
Indeed, fixed in gcc 3.3.