blob: bedff389b05de05b1341c017c472540da4fde99d [file] [log] [blame]
Marshall Clow5f2d5b92013-10-12 22:49:17 +00001//===----------------------------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
Richard Barton037efda2016-03-23 21:04:11 +00009//
10// UNSUPPORTED: libcpp-has-no-threads
Eric Fiselierfaa9a312015-08-19 04:10:15 +000011// UNSUPPORTED: c++98, c++03
12
Marshall Clow5f2d5b92013-10-12 22:49:17 +000013// <future>
14
15// class packaged_task<R(ArgTypes...)>
16// template <class F, class Allocator>
Marshall Clow07546f32015-06-30 14:16:49 +000017// packaged_task(allocator_arg_t, const Allocator& a, F&& f);
Marshall Clow5f2d5b92013-10-12 22:49:17 +000018// These constructors shall not participate in overload resolution if
19// decay<F>::type is the same type as std::packaged_task<R(ArgTypes...)>.
20
21#include <future>
22#include <cassert>
23
Eric Fiselierfaa9a312015-08-19 04:10:15 +000024#include "test_allocator.h"
Marshall Clow5f2d5b92013-10-12 22:49:17 +000025
26struct A {};
27typedef std::packaged_task<A(int, char)> PT;
28typedef volatile std::packaged_task<A(int, char)> VPT;
29
30int main()
31{
Eric Fiselierfaa9a312015-08-19 04:10:15 +000032 PT p { std::allocator_arg_t{}, test_allocator<A>{}, VPT {}}; // expected-error {{no matching constructor for initialization of 'PT' (aka 'packaged_task<A (int, char)>')}}
33 // expected-note@future:* 1 {{candidate template ignored: disabled by 'enable_if'}}
Marshall Clow5f2d5b92013-10-12 22:49:17 +000034}