[VC2005] Dependent name resolution problem in template specializations
Hello,
In template specializations, VC 2005 sometimes seems to fail
correctly resolving dependent names.
The problem I ran into gives me the following error:
C2064: term does not evaluate to a function taking <n> arguments
Here is some minimal code to reproduce the problem:
template<class T> struct A { static int f(); };
template<class, size_t> struct B;
template<class T>
struct B<T,
sizeof(A<T>::f()) //C2064
>
{};
Note that if this is tried on a non-template class, or outside
another template's specialization, everything gets back to normal:
struct C { static int f(); };
template<class T>
struct B<T,
sizeof(C::f()) //OK
>
{};
void foo()
{
size_t sz = sizeof(A<T>::f()); //OK
}
As far as I can tell, this code is standard conformant so to my
understanding it should compile.
This issue is not listed in the "Nonstandard behavior" section of
the documentation (unless it is included in the subsection
concerning 14.6.2, but this subsection only mentions problems with
non dependent names, which is the contrary of the problem I am
facing).
Am I missing something, or is it a compiler bug?
Can anyone see a solution to that problem?
Thanks in advance for your attention.
--
IR