• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // UNSUPPORTED: c++03
10 
11 // UNSUPPORTED: no-threads
12 
13 // check that <future> functions are marked [[nodiscard]]
14 
15 // clang-format off
16 
17 #include <future>
18 
test()19 void test() {
20   std::async([]() {});                   // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
21   std::async(std::launch::any, []() {}); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
22 }
23