FIX: /GX May Cause C1001 When Using Base Class' Operator Delete (172609)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 5.0
This article was previously published under Q172609 SYMPTOMS
When attempting to use a base class' operator delete, and using the /GX
switch to enable Visual C++ Exception Handling, the following error may be
generated:
fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 1188)
CAUSE
This error will be generated if the base class has a virtual function, the
derived class uses the base class operator delete via a using declaration
or an access declaration, and the derived class has a function prototyped
to return a pointer to a base class, but actually returns a pointer to the
derived class. An example can be found in the sample code below.
RESOLUTION
Do not use the /GX switch when attempting to use the base class operator
delete.
Implement an operator delete in the derived class that calls the base class
operator delete.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This bug has been fixed in Visual Studio
97 Service Pack 3.
For more information, please see the following article in the Microsoft
Knowledge Base:
170365
INFO: Visual Studio 97 Service Packs - What, Where, and Why
Modification Type: | Minor | Last Reviewed: | 7/5/2005 |
---|
Keywords: | kbBug kbcode kbCompiler kbCPPonly kberrmsg kbfix kbVS97sp3fix KB172609 |
---|
|