Article ID: 125495
Article Last Modified on 10/24/2003
/* Compile options needed: none
Use /DFIX to work around the problem
*/
template <class Type>
class TestClass
{
Type t;
};
enum EnumType { E1, E2, E3 };
#ifndef FIX // Used to reproduce the problem
template <class Type>
EnumType EnumReturnDoesntWork( const TestClass<Type> &a )
{
return E1;
}
#else // Used to work around the problem
typedef EnumType MyType;
template <class Type>
MyType EnumReturnDoesntWork( const TestClass<Type> &a )
{
return E1;
}
#endif
void main(void)
{
TestClass<int> a;
EnumReturnDoesntWork( a ); // C2065
}
Additional query words: 2.00 2.10 9.00 9.10 noupdate
Keywords: kbbug kbcpponly kbcompiler KB125495