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 // <unordered_set>
10 
11 // iterator insert(const_iterator p, const value_type& x);
12 
13 // REQUIRES: has-unix-headers
14 // UNSUPPORTED: !libcpp-has-legacy-debug-mode, c++03
15 
16 #include <unordered_set>
17 
18 #include "check_assertion.h"
19 
main(int,char **)20 int main(int, char**) {
21     typedef std::unordered_set<double> C;
22     typedef C::value_type P;
23     C c;
24     C c2;
25     C::const_iterator e = c2.end();
26     P v(3.5);
27     TEST_LIBCPP_ASSERT_FAILURE(
28         c.insert(e, v),
29         "unordered_set::insert(const_iterator, const value_type&) called with an iterator not referring to this unordered_set");
30 
31     return 0;
32 }
33