This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Error with template template args (gcc2.95.1)
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Error with template template args (gcc2.95.1)
- From: Wolfgang Bangerth <bangerth at wetter dot geophysik dot uni-muenchen dot de>
- Date: Tue, 19 Oct 1999 15:49:14 +0200 (MEST)
Hi there,
the following program does not compile with gcc 2.95.1 though I believe
it should (and did with egcs1.1.2):
-----------------------------------------------------------
template <class T>
struct TemplateClass {
typedef int local_type;
};
template <template <class> class X, class T>
struct TemplateTemplateClass {
// these two lines work:
// struct X_T : X<T> {};
// typedef typename X_T::local_type local_type;
// this doesn't work with gcc 2.95.1:
typedef typename X<T>::local_type local_type;
static void f(local_type);
};
template <template <class> class X, class T>
void TemplateTemplateClass<X,T>::f (local_type) {};
void main () {
TemplateTemplateClass<TemplateClass,int>::f(1);
}
-----------------------------------------------------------
Error messages are:
test.cc:20: `X<T>' is not a class, struct, or union type
test.cc:20: syntax error before `{'
Regards
Wolfgang
[PS: Please reply to the address below.]
~/tmp/test > c++ -v
Reading specs from
/home/bangerth/bin/gcc-2.95.1/lib/gcc-lib/i686-pc-linux-gnu/2.95.1/specs
gcc version 2.95.1 19990816 (release)
-------------------------------------------------------------------------
Wolfgang Bangerth email: wolfgang.bangerth@iwr.uni-heidelberg.de
www: http://gaia.iwr.uni-heidelberg.de/~wolf