On Dec 7, 2007, at 5:23 PM, Gustav Broberg wrote:

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>();

}


-------------------------------------------------




That dies a horrible death also

 g++ -o test test.cpp
test.cpp:13: error: template-id 'f<>' for 'void X<float>::f()' does not match any template declaration
test.cpp:13: error: invalid function declaration