FIX: Abstract Class Instantiated as a Temporary Object (151168)
The information in this article applies to:
- The Standard C++ Library, when used with:
- Microsoft Visual C++, 32-bit Professional Edition 4.0
- Microsoft Visual C++, 32-bit Learning Edition 4.0
This article was previously published under Q151168 SYMPTOMS
In certain cases, Visual C++ allows abstract classes to be instantiated
as temporary objects. The sample code below demonstrates this.
CAUSE
An abstract class should not be allowed to be instantiated as an object.
An abstract class is any class with at least one pure virtual function.
This is part of the definition of the C++ language.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products
listed at the beginning of this article. This bug was corrected in
Microsoft Visual C++, 32-bit Edition, version 4.1.
Modification Type: | Major | Last Reviewed: | 11/18/2003 |
---|
Keywords: | kbbug kbCompiler kbCPPonly kbfix kbLangCPP KB151168 |
---|
|