1//===----------------------------------------------------------------------===// 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//===----------------------------------------------------------------------===// 9// 10// UNSUPPORTED: libcpp-has-no-threads 11// UNSUPPORTED: c++98, c++03 12 13// <future> 14 15// class packaged_task<R(ArgTypes...)> 16// template <class F, class Allocator> 17// packaged_task(allocator_arg_t, const Allocator& a, F&& f); 18// 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 24#include "test_allocator.h" 25 26struct A {}; 27typedef std::packaged_task<A(int, char)> PT; 28typedef volatile std::packaged_task<A(int, char)> VPT; 29 30int main() 31{ 32 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'}} 34} 35