2015-09-06 14:46:46 -04:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
//
|
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
|
//
|
|
|
|
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
|
|
|
// Source Licenses. See LICENSE.TXT for details.
|
|
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
2016-07-23 16:47:26 -04:00
|
|
|
//
|
|
|
|
|
// UNSUPPORTED: libcpp-has-no-threads
|
2015-09-06 14:46:46 -04:00
|
|
|
|
|
|
|
|
// <future>
|
|
|
|
|
|
|
|
|
|
// class future<R>
|
|
|
|
|
|
|
|
|
|
// future(const future&) = delete;
|
|
|
|
|
|
|
|
|
|
#include <future>
|
2015-12-30 06:54:09 -05:00
|
|
|
|
|
|
|
|
#include "test_macros.h"
|
2015-09-06 14:46:46 -04:00
|
|
|
|
|
|
|
|
int main()
|
|
|
|
|
{
|
2015-12-30 06:54:09 -05:00
|
|
|
#if TEST_STD_VER >= 11
|
2015-09-06 14:46:46 -04:00
|
|
|
{
|
2015-12-30 06:54:09 -05:00
|
|
|
std::future<int> f0;
|
|
|
|
|
std::future<int> f = f0; // expected-error {{call to deleted constructor of 'std::future<int>'}}
|
2015-09-06 14:46:46 -04:00
|
|
|
}
|
|
|
|
|
{
|
2015-12-30 06:54:09 -05:00
|
|
|
std::future<int &> f0;
|
|
|
|
|
std::future<int &> f = f0; // expected-error {{call to deleted constructor of 'std::future<int &>'}}
|
2015-09-06 14:46:46 -04:00
|
|
|
}
|
|
|
|
|
{
|
2015-12-30 06:54:09 -05:00
|
|
|
std::future<void> f0;
|
|
|
|
|
std::future<void> f = f0; // expected-error {{call to deleted constructor of 'std::future<void>'}}
|
2015-09-06 14:46:46 -04:00
|
|
|
}
|
2015-12-30 06:54:09 -05:00
|
|
|
#else
|
2015-09-06 14:46:46 -04:00
|
|
|
{
|
2015-12-30 06:54:09 -05:00
|
|
|
std::future<int> f0;
|
|
|
|
|
std::future<int> f = f0; // expected-error {{calling a private constructor of class 'std::__1::future<int>'}}
|
2015-09-06 14:46:46 -04:00
|
|
|
}
|
|
|
|
|
{
|
2015-12-30 06:54:09 -05:00
|
|
|
std::future<int &> f0;
|
|
|
|
|
std::future<int &> f = f0; // expected-error {{calling a private constructor of class 'std::__1::future<int &>'}}
|
2015-09-06 14:46:46 -04:00
|
|
|
}
|
|
|
|
|
{
|
2015-12-30 06:54:09 -05:00
|
|
|
std::future<void> f0;
|
|
|
|
|
std::future<void> f = f0; // expected-error {{calling a private constructor of class 'std::__1::future<void>'}}
|
2015-09-06 14:46:46 -04:00
|
|
|
}
|
2015-12-30 06:54:09 -05:00
|
|
|
#endif
|
2015-09-06 14:46:46 -04:00
|
|
|
}
|