This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15534] Fails to inherit types from base class
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 May 2004 13:42:38 -0000
- Subject: [Bug c++/15534] Fails to inherit types from base class
- References: <20040519030420.15534.igodard@pacbell.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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