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