The information in this article applies to:
SYMPTOMS
In a C++ program, when you define a local struct, class, or union in which
one or more of the fields contains a struct, class, or union type that
defines member functions, the compiler generates these compiler errors:
In Visual C++ versions 2.x: In Visual C++ version 4.0: Using any MFC classes in the local structure will also cause this problem. CAUSEFunction definitions are found in a local struct, class, or union definition. Support for member functions of local classes is part of the current draft of the C++ Working Paper, but they are not currently supported by Microsoft Visual C++. They will be supported in a future release of Microsoft Visual C++. RESOLUTION
To work around the problem, choose one of the following two methods:
-or- STATUSThis behavior is by design. MORE INFORMATIONIn the sample code below, even though the local struct S does not, at first glance, appear to have any member functions, the compiler attempts to generate a non-trival default constructor and destructor for the local struct S. Because the compiler is not designed to support member functions of local classes, this hidden attempt to generate two such functions causes the compiler to produce the error messages descibed in the SYMPTOMS section of this article. Sample Code to Reproduce Behavior
Additional query words: 8.00 8.00c 9.00 9.10
Keywords : kberrmsg kbCompiler kbCPPonly kbVC |
Last Reviewed: July 21, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |