33 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// <future>12 13// class promise<R>14 15// promise(const promise&) = delete;16 17#include <future>18 19void f() {20 {21 std::promise<int> p0;22 std::promise<int> p(p0); // expected-error {{call to deleted constructor of 'std::promise<int>'}}23 }24 {25 std::promise<int &> p0;26 std::promise<int &> p(p0); // expected-error {{call to deleted constructor of 'std::promise<int &>'}}27 }28 {29 std::promise<void> p0;30 std::promise<void> p(p0); // expected-error {{call to deleted constructor of 'std::promise<void>'}}31 }32}33