Article ID: 164000
Article Last Modified on 7/5/2005
/* 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: kbVC420bug kbDSupport typeid RTTI
Keywords: kbbug kbfix kblangcpp kbvc500fix kbcpponly kbcode kbcompiler KB164000