blob: 1a719c0fd6d73f1c2b72d7872f330c20ae6bdaa7 [file] [log] [blame]
Marshall Clowb6ad8442017-11-23 01:25:03 +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//===----------------------------------------------------------------------===//
9//
10// UNSUPPORTED: libcpp-has-no-threads
11// UNSUPPORTED: c++98, c++03
12
13// <future>
14
15// template <class F, class... Args>
16// future<typename result_of<F(Args...)>::type>
17// async(F&& f, Args&&... args);
18
19// template <class F, class... Args>
20// future<typename result_of<F(Args...)>::type>
21// async(launch policy, F&& f, Args&&... args);
22
23
24#include <future>
25#include <atomic>
26#include <memory>
27#include <cassert>
28
29#include "test_macros.h"
30
31int foo (int x) { return x; }
32
33int main ()
34{
35 std::async( foo, 3); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
36 std::async(std::launch::async, foo, 3); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
37}