This is the mail archive of the gcc-help@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]

g++ compile error in unused template


Hi list,

does anyone know why I get the following error when compiling this code?

template<class T>
struct Base {
        template <class A>
        void func() {}
};

template<class T>
struct Child : public Base<T> {
        unsigned func2() {
                Base<T>::func< Child<T> >();
        }
};

main() {}

The compiler output is:

x.cc: In member function âunsigned int Child<T>::func2()â:
x.cc:10:41: error: expected primary-expression before â>â token
x.cc:10:43: error: expected primary-expression before â)â token

Compiler is "g++ (Debian 4.6.2-9) 4.6.2", but the result is the same
even with g++ 4.4 and g++ 4.5.

Thank you,
-Michal


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