aboutsummaryrefslogtreecommitdiff
path: root/test/std/containers/associative/set/incomplete_type.pass.cpp
blob: d3a1d6638d7ecadbb30fcdf4c892f5f710779f11 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <set>

// Check that std::set and it's iterators can be instantiated with an incomplete
// type.

#include <set>

struct A {
    typedef std::set<A> Set;
    int data;
    Set m;
    Set::iterator it;
    Set::const_iterator cit;
};

inline bool operator==(A const& L, A const& R) { return &L == &R; }
inline bool operator<(A const& L, A const& R)  { return L.data < R.data; }
int main() {
    A a;
}