1 // RUN: %clang_cc1 -triple x86_64-unknown-linux -fsyntax-only -verify -fno-rtti %s
2 
3 namespace std {
4   class type_info;
5 }
6 
f()7 void f()
8 {
9   (void)typeid(int); // expected-error {{use of typeid requires -frtti}}
10 }
11 
12 namespace {
13 struct A {
~A__anonc3739bb10111::A14   virtual ~A(){};
15 };
16 
17 struct B : public A {
B__anonc3739bb10111::B18   B() : A() {}
19 };
20 }
21 
isa_B(A * a)22 bool isa_B(A *a) {
23   return dynamic_cast<B *>(a) != 0; // expected-error {{use of dynamic_cast requires -frtti}}
24 }
25 
getMostDerived(A * a)26 void* getMostDerived(A* a) {
27   // This cast does not use RTTI.
28   return dynamic_cast<void *>(a);
29 }
30