//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // has_virtual_destructor #include template void test_has_virtual_destructor() { static_assert( std::has_virtual_destructor::value, ""); static_assert( std::has_virtual_destructor::value, ""); static_assert( std::has_virtual_destructor::value, ""); static_assert( std::has_virtual_destructor::value, ""); } template void test_has_not_virtual_destructor() { static_assert(!std::has_virtual_destructor::value, ""); static_assert(!std::has_virtual_destructor::value, ""); static_assert(!std::has_virtual_destructor::value, ""); static_assert(!std::has_virtual_destructor::value, ""); } class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; struct A { ~A(); }; int main() { test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_virtual_destructor(); test_has_virtual_destructor(); }