[lld][WebAssembly] Reinstate mistakenly disabled test. NFC
[llvm-project.git] / clang / test / SemaCXX / no-rtti.cpp
blob8082da219d5ad6d166ce5543a7d6ed3b3711f435
1 // RUN: %clang_cc1 -triple x86_64-unknown-linux -fsyntax-only -verify -fno-rtti %s
3 namespace std {
4 class type_info;
7 void f()
9 (void)typeid(int); // expected-error {{use of typeid requires -frtti}}
12 namespace {
13 struct A {
14 virtual ~A(){};
17 struct B : public A {
18 B() : A() {}
22 bool isa_B(A *a) {
23 return dynamic_cast<B *>(a) != 0; // expected-error {{use of dynamic_cast requires -frtti}}
26 void* getMostDerived(A* a) {
27 // This cast does not use RTTI.
28 return dynamic_cast<void *>(a);