This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]