FIX: C1001 Compiler File MAIN.C Line 413Last reviewed: September 19, 1997Article ID: Q164000 |
The information in this article applies to:
SYMPTOMSCalling typeid with a temporary object causes the following error:
fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'd:\backend\src\P2\main.c', line 413)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more
information
Error executing cl.exe.
RESOLUTIONInstead of calling typeid with a temporary object, create a stack object and then call typeid, referencing the stack object.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Visual C++ version 5.0.
MORE INFORMATION
Sample Code
/* Compile options needed: none
*/
#include <typeinfo>
struct X {
X() {};
~X() {};
};
// This main function will cause the error.
void main()
{
const type_info& t = typeid(X());
}
// For the workaround, replace main above with the following:
void main()
{
X y;
const type_info& t = typeid(y);
}
|
Additional query words: typeid RTTI
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |