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]

Error with template template args (gcc2.95.1)



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



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