blob: efac4cbd1e3a49a54a327bc755a2f5e6e8a444d8 [file] [log] [blame]
// PR c++/61020
// { dg-options "-O2" }
// { dg-do run }
#include <typeinfo>
struct Base {
virtual ~Base() { }
};
struct Derived : public Base {
};
int compare(const Base& base)
{
return typeid(base) == typeid(typeid(Derived));
}
int main()
{
Base base;
Derived derived;
if (compare(base)) return 1;
if (compare(derived)) return 2;
return 0;
}