Eric Fiselier | 774c7c5 | 2016-02-10 20:46:23 +0000 | [diff] [blame] | 1 | |
| 2 | |
| 3 | //===----------------------------------------------------------------------===// |
| 4 | // |
| 5 | // The LLVM Compiler Infrastructure |
| 6 | // |
| 7 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 8 | // Source Licenses. See LICENSE.TXT for details. |
| 9 | // |
| 10 | //===----------------------------------------------------------------------===// |
| 11 | |
| 12 | // <unordered_set> |
| 13 | |
| 14 | // Check that std::unordered_set and it's iterators can be instantiated with an incomplete |
| 15 | // type. |
| 16 | |
| 17 | #include <unordered_set> |
| 18 | |
| 19 | template <class Tp> |
| 20 | struct MyHash { |
| 21 | MyHash() {} |
| 22 | std::size_t operator()(Tp const&) const {return 42;} |
| 23 | }; |
| 24 | |
| 25 | struct A { |
| 26 | typedef std::unordered_set<A, MyHash<A> > Map; |
| 27 | Map m; |
| 28 | Map::iterator it; |
| 29 | Map::const_iterator cit; |
| 30 | Map::local_iterator lit; |
| 31 | Map::const_local_iterator clit; |
| 32 | }; |
| 33 | |
| 34 | inline bool operator==(A const& L, A const& R) { return &L == &R; } |
| 35 | |
| 36 | int main() { |
| 37 | A a; |
| 38 | } |