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 // UNSUPPORTED: libcpp-has-no-threads 10 11 // <thread> 12 13 // class thread 14 15 // thread& operator=(thread&& t); 16 17 #include <thread> 18 #include <cassert> 19 #include <cstdlib> 20 #include <exception> 21 #include <utility> 22 23 #include "test_macros.h" 24 25 struct G 26 { 27 void operator()() { } 28 }; 29 30 void f1() 31 { 32 std::_Exit(0); 33 } 34 35 int main(int, char**) 36 { 37 std::set_terminate(f1); 38 { 39 G g; 40 std::thread t0(g); 41 std::thread t1; 42 t0 = std::move(t1); 43 assert(false); 44 } 45 46 return 0; 47 } 48