diff options
Diffstat (limited to 'test/std/containers/associative/multimap/incomplete_type.pass.cpp')
-rw-r--r-- | test/std/containers/associative/multimap/incomplete_type.pass.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/std/containers/associative/multimap/incomplete_type.pass.cpp b/test/std/containers/associative/multimap/incomplete_type.pass.cpp new file mode 100644 index 000000000000..c461eb38139d --- /dev/null +++ b/test/std/containers/associative/multimap/incomplete_type.pass.cpp @@ -0,0 +1,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. +// +//===----------------------------------------------------------------------===// + +// <map> + +// Check that std::multimap and it's iterators can be instantiated with an incomplete +// type. + +#include <map> + +struct A { + typedef std::multimap<A, A> Map; + int data; + Map m; + Map::iterator it; + Map::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; +} |