Auch... sorry for that, I use 4.1.3 and for me it compiles fine.
I'm pretty sure it's valid C++ -- here's a minimal test case on what I
think it chokes on (tried with success in gcc 4.1 and Comeau):
-------------------------------------------------
#include <iostream>
template<class T> class X {
public:
template <typename T2>
static void f();
};
template <typename T> template <typename T2>
void X<T>::f() { std::cerr << "T" << std::endl; }
template <> template <typename T2>
void X<float>::f() { std::cerr << "float" << std::endl; }
int main() {
X<char *> a;
X<float> b;
a.f<void>();
b.f<void>();
}
-------------------------------------------------