BUG: Deleting a Struct Typedef Causes C1059, C1063, or C1001Last reviewed: July 24, 1997Article ID: Q133068 |
The information in this article applies to:
SYMPTOMSThe sample code fragment listed at the end of this article incorrectly deletes a typedef of a pointer to a structure, which generates the following compiler errors: - For Visual C++ 5.0 for Windows NT:
fatal error C1001: INTERNAL COMPILER ERROR (compiler file '.\toil.c', line 3645)
fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'toil.c', line 4094)
fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'toil.c', line 4051)
fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'toil.c', line 3128)
fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'toil.c', line 2847)
fatal error C1001: INTERNAL COMPILER ERROR (compiler file '@(#)main.c:1.82', line 289)
fatal error C1059: compiler is out of near heap space
fatal error C1063:
fatal error C1001: INTERNAL COMPILER ERROR (compiler file '2pass/getattr.c', line 346) Contact Microsoft Product Support Services
RESOLUTIONThe above error messages are misleading and do not point out the real problem, which is that you cannot delete a typedef. Additionally, the operand of delete must be a pointer returned by the new operator. Using delete on a pointer to an object not allocated with new gives unpredictable results.
STATUSMicrosoft 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.
MORE INFORMATION
Sample Code to Reproduce Problem
/* Compile options needed: none */ typedef struct { int x; }MY_STRUCT, *LPMY_STRUCT; LPMY_STRUCT pMyStruct = new MY_STRUCT; void MyTestFunction() { delete pMyStruct; // ok. delete LPMY_STRUCT; // Can not delete a type. } |
Additional query words: 8.0 8.0c 8.00 8.00c 9.0 9.00 9.1 9.10 10.00 10.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |