6 const std::type_info *a;
9 bool is_polymorphic() {
11 const std::type_info &a1 = typeid( (result=true), *(T*)0);
16 struct non_polymorphic {};
17 struct polymorphic { virtual ~polymorphic() {} };
21 if (is_polymorphic<int>()) __builtin_abort();
22 if (is_polymorphic<non_polymorphic>()) __builtin_abort();
25 is_polymorphic<polymorphic>();
26 __builtin_abort(); // should have thrown bad_typeid
28 catch (std::bad_typeid&)