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 // <memory> 10 11 // class bad_weak_ptr 12 // : public std::exception 13 // { 14 // public: 15 // bad_weak_ptr(); 16 // }; 17 18 #include <memory> 19 #include <type_traits> 20 #include <cassert> 21 #include <cstring> 22 23 #include "test_macros.h" 24 main(int,char **)25int main(int, char**) 26 { 27 static_assert((std::is_base_of<std::exception, std::bad_weak_ptr>::value), ""); 28 std::bad_weak_ptr e; 29 std::bad_weak_ptr e2 = e; 30 e2 = e; 31 assert(std::strcmp(e.what(), "bad_weak_ptr") == 0); 32 33 return 0; 34 } 35