diff options
Diffstat (limited to 'clang/test/SemaCXX/no-rtti.cpp')
-rw-r--r-- | clang/test/SemaCXX/no-rtti.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/no-rtti.cpp b/clang/test/SemaCXX/no-rtti.cpp index 3d6e109551d..a171b3cde2c 100644 --- a/clang/test/SemaCXX/no-rtti.cpp +++ b/clang/test/SemaCXX/no-rtti.cpp @@ -22,3 +22,8 @@ struct B : public A { bool isa_B(A *a) { return dynamic_cast<B *>(a) != 0; // expected-error {{cannot use dynamic_cast with -fno-rtti}} } + +void* getMostDerived(A* a) { + // This cast does not use RTTI. + return dynamic_cast<void *>(a); +} |