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 | // check that <unordered_set> functions are marked [[nodiscard]] |
12 | |
13 | // clang-format off |
14 | |
15 | #include <unordered_set> |
16 | |
17 | void unordered_set_test() { |
18 | std::unordered_set<int> unordered_set; |
19 | unordered_set.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} |
20 | } |
21 | |
22 | void unordered_multiset_test() { |
23 | std::unordered_multiset<int> unordered_multiset; |
24 | unordered_multiset.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} |
25 | } |
26 | |