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