Revert "[libc] Use best-fit binary trie to make malloc logarithmic" (#117065)
[llvm-project.git] / libcxx / test / std / containers / container.node / node_handle.nodiscard.verify.cpp
blob4c47563f6c4467c1851f2d18422470abdd252cae
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 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03
10 // UNSUPPORTED: (c++11 || c++14 || c++17) && !stdlib=libc++
12 // Make sure the various node handles mark their .empty() method with
13 // [[nodiscard]] starting with C++20
15 #include <map>
16 #include <set>
17 #include <unordered_map>
18 #include <unordered_set>
20 #include "test_macros.h"
22 void test() {
23 #if TEST_STD_VER >= 17
25 std::map<int, int>::node_type node;
26 node.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
29 std::multimap<int, int>::node_type node;
30 node.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
32 #endif // TEST_STD_VER >= 17
34 std::set<int> node;
35 node.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
38 std::multiset<int> node;
39 node.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
42 std::unordered_map<int, int> node;
43 node.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
46 std::unordered_multimap<int, int> node;
47 node.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
50 std::unordered_set<int> node;
51 node.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
54 std::unordered_multiset<int> node;
55 node.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}