31 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// UNSUPPORTED: c++03, c++11, c++14, c++1711 12// stop_token() noexcept;13 14#include <cassert>15#include <stop_token>16#include <type_traits>17 18#include "test_macros.h"19 20static_assert(std::is_nothrow_default_constructible_v<std::stop_token>);21 22int main(int, char**) {23 {24 std::stop_token st = {}; // implicit25 assert(!st.stop_possible());26 assert(!st.stop_requested());27 }28 29 return 0;30}31