This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
g++ compile error in unused template
- From: Michal Sojka <sojka at os dot inf dot tu-dresden dot de>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 07 Feb 2012 15:29:33 +0100
- Subject: 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