[Bug c++/15534] Fails to inherit types from base class

bangerth at dealii dot org gcc-bugzilla@gcc.gnu.org
Thu May 20 13:37:00 GMT 2004


------- Additional Comments From bangerth at dealii dot org  2004-05-19 13:42 -------
In your example, 
------ 
template <class T> class B: A<T> 
{ 
typedef t t1; 
}; 
------ 
you reference the name 't'. Since 't' does not depend on the template 
argument 'T', it is non-dependent and needs to be looked up at the 
time of declaration of the template. However, since name lookup does 
not look into template dependent base classes such as A<T> it doesn't 
find anything. The solution is to make sure that 't' is qualified as 
dependent, for example by writing 'typename A<T>::t'. 
 
This is really no different than all the other name lookup things that 
we believe are well-documented in the non-bugs and changes-in-3.4 sections 
of our web pages. Please review these if you are unsure. 
 
W. 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15534



More information about the Gcc-bugs mailing list