1 //===----------------------------------------------------------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 // test exception 10 11 #include <exception> 12 #include <type_traits> 13 #include <cassert> 14 15 int main() 16 { 17 static_assert(std::is_polymorphic<std::exception>::value, 18 "std::is_polymorphic<std::exception>::value"); 19 std::exception b; 20 std::exception b2 = b; 21 b2 = b; 22 const char* w = b2.what(); 23 assert(w); 24 } 25