BUG: Enum in Function Template Causes C2065 Compiler Error (125495)
The information in this article applies to:
- Microsoft Visual C++ 2.0
- Microsoft Visual C++ 2.1
This article was previously published under Q125495 SYMPTOMS
When an enum type is used as a return type of a function template, the
compiler generates the following error as the function template is
instantiated:
Error C2065 : 'FunctionName' : undeclared identifier
Error C2064 : term does not evaluate to a function
This error happens only when the function template takes arguments that
involve a user-defined class template. For more information, please see the
"Sample Code" section in this article.
RESOLUTION
To work around the problem, use a typedef to define the enum type, and
use it as the return type for the function template.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. We are researching this problem and will
post new information here in the Microsoft Knowledge Base as it becomes
available.
Modification Type: | Major | Last Reviewed: | 10/24/2003 |
---|
Keywords: | kbbug kbCompiler kbCPPonly KB125495 |
---|
|