2015-09-06 14:46:46 -04:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
//
|
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
|
//
|
|
|
|
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
|
|
|
// Source Licenses. See LICENSE.TXT for details.
|
|
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
2016-07-23 16:47:26 -04:00
|
|
|
// UNSUPPORTED: libcpp-no-rtti
|
|
|
|
|
|
|
|
|
|
// "support/test_macros.hpp"
|
2015-09-06 14:46:46 -04:00
|
|
|
|
2016-07-23 16:47:26 -04:00
|
|
|
// #define TEST_HAS_NO_RTTI
|
2015-09-06 14:46:46 -04:00
|
|
|
|
2016-07-23 16:47:26 -04:00
|
|
|
#include "test_macros.h"
|
|
|
|
|
|
|
|
|
|
#if defined(TEST_HAS_NO_RTTI)
|
|
|
|
|
#error Macro defined unexpectedly
|
2015-09-06 14:46:46 -04:00
|
|
|
#endif
|
|
|
|
|
|
2016-07-23 16:47:26 -04:00
|
|
|
struct A { virtual ~A() {} };
|
|
|
|
|
struct B : A {};
|
|
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
|
A* ptr = new B;
|
|
|
|
|
(void)dynamic_cast<B*>(ptr);
|
2015-09-06 14:46:46 -04:00
|
|
|
}
|