|
BUG: C2065 in External Definition of Nested Member FunctionArticle ID: Q151586Creation Date: 27-MAY-1996 Revision Date: 18-JUL-1996
The information in this article applies to:
SYMPTOMS
An undeclared id error C2065 in the external definition of nested member
function for parameters of user-defined type, enum, struct, and class in
the enclosed scope appears when typedef is used.
RESOLUTION
Please refer to the More Information section of this article for a sample
code and workarounds.
STATUS
Microsoft has confirmed this to be 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.
MORE INFORMATION
The following code reproduces the error when compiled. The undeclared
identifier error is reported for the enum E declared in the enclosed
scope. Declarations in global scope do not produce this error.
//Compile option needed -- none
struct A {
enum E {e = 1};
struct B{
void g(int);
void f(E);
};
};
typedef A::B C;
void C::g(int i){}
void C::f(E e){} // error C2065: 'E' : undeclared identifier
WORKAROUND
|
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.
©1997 Microsoft Corporation. All rights reserved. Legal Notices.