I have code written for Clang 3.2 that I am trying to run to run in VC ++ 12. Clang 3.2+ and GCC 4.8 have no problem with this, but VC ++ 12 complains. Here is the minimal snippet that causes the problem:
template <int(*ptr)()>
class foo {};
template<int N>
int ReturnsN() { return N; }
template<int N>
class bar {
typedef foo<ReturnsN<N>> fooN;
};
Now I'm sure this is a compiler error (but please let me know if it is not!) An error has occurred:
'specialization' : cannot convert from 'int (__cdecl *)(void)' to 'int (__cdecl *)(void)'
So does anyone know a decent job? It seems that the compiler is convinced that the specialized function is not fully defined.
EDIT: I should also note that I tried this with both the compiler and CTP in November 2013. Both problems are the same.
source
share