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// <map>
10
11// Check that std::map and its iterators can be instantiated with an incomplete
12// type.
13
14#include <map>
15
16#include "test_macros.h"
17
18struct A {
19 typedef std::map<A, A> Map;
20 int data;
21 Map m;
22 Map::iterator it;
23 Map::const_iterator cit;
24};
25
26inline bool operator==(A const& L, A const& R) { return &L == &R; }
27inline bool operator<(A const& L, A const& R) { return L.data < R.data; }
28int main(int, char**) {
29 A a;
30
31 return 0;
32}
33

source code of libcxx/test/std/containers/associative/map/incomplete_type.pass.cpp