<div dir="ltr">> <span style="font-size:12.8px">hash_map still looks broken to me.</span><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Uh oh, Sorry :-S. The original breakage was caused by the removal of a typedef "hash_map" used, but I'm sure I fixed that.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">> </span><span style="font-size:12.8px">should not they be prefixed with __gnu_cxx:: ?</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">No, they are in the correct namespace. The "hash_map" part of the name means they belong to "<unordered_map>", and the actual type is defined in that header.</span></div><div><br></div><div>Could you give me more information about the breakage your seeing? The actual compiler diagnostics if possible? I also committed other sizable changes to <__hash_table> in <span style="font-size:inherit;font-weight:inherit">r260513 so that may be related.</span></div><div><br></div><div>Let me know if you need this reverted. If possible I would like to hold off, at least until more is known.</div><div><br></div><div>/Eric</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 12, 2016 at 1:31 PM, Evgenii Stepanov <span dir="ltr"><<a href="mailto:eugeni.stepanov@gmail.com" target="_blank">eugeni.stepanov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
hash_map still looks broken to me.<br>
I don't have a simple reproducer, but these declarations in __hash_table:<br>
<span class=""><br>
template <class _HashIterator> class _LIBCPP_TYPE_VIS_ONLY __hash_map_iterator;<br>
 template <class _HashIterator> class _LIBCPP_TYPE_VIS_ONLY<br>
__hash_map_const_iterator;<br>
<br>
</span>should not they be prefixed with __gnu_cxx:: ?<br>
<br>
Clang says that std::__1::__hash_const_iterator and<br>
__gnu_cxx::__hash_map_const_iterator are not friends and<br>
__non_const_iterator at ext/hash_map:432 is private.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On Wed, Feb 10, 2016 at 12:46 PM, Eric Fiselier via cfe-commits<br>
<<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br>
> Author: ericwf<br>
> Date: Wed Feb 10 14:46:23 2016<br>
> New Revision: 260431<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=260431&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=260431&view=rev</a><br>
> Log:<br>
> Recommit r260012 - Cleanup node-type handling in the unordered containers.<br>
><br>
> This time I kept <ext/hash_map> working!<br>
><br>
> This patch is the first in a series of patches that's meant to better<br>
> support unordered_map. unordered_map has a special "value_type" that<br>
> differs from pair<const Key, Value>. In order to meet the EmplaceConstructible<br>
> and CopyInsertable requirements we need to teach __hash_table about this<br>
> special value_type.<br>
><br>
> This patch creates a "__hash_node_types" traits class that contains<br>
> all of the typedefs needed by the unordered containers and it's iterators.<br>
> These typedefs include ones for each node type and  node pointer type,<br>
> as well as special typedefs for "unordered_map"'s value type.<br>
><br>
> As a result of this change all of the unordered containers now all support<br>
> incomplete types.<br>
><br>
> As a drive-by fix I changed the difference_type in __hash_table to always<br>
> be ptrdiff_t. There is a corresponding change to size_type but it cannot<br>
> take affect until an ABI break.<br>
><br>
> This patch will be followed up shortly with fixes for various unordered_map<br>
> bugs and problems.<br>
><br>
> Added:<br>
>     libcxx/trunk/test/libcxx/containers/unord/key_value_traits.pass.cpp<br>
>     libcxx/trunk/test/std/containers/unord/iterator_difference_type.pass.cpp<br>
>     libcxx/trunk/test/std/containers/unord/unord.map/incomplete_type.pass.cpp<br>
>     libcxx/trunk/test/std/containers/unord/unord.multimap/incomplete.pass.cpp<br>
>     libcxx/trunk/test/std/containers/unord/unord.multiset/incomplete.pass.cpp<br>
>     libcxx/trunk/test/std/containers/unord/unord.set/incomplete.pass.cpp<br>
> Modified:<br>
>     libcxx/trunk/include/__config<br>
>     libcxx/trunk/include/__hash_table<br>
>     libcxx/trunk/include/ext/hash_map<br>
>     libcxx/trunk/include/unordered_map<br>
><br>
> Modified: libcxx/trunk/include/__config<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=260431&r1=260430&r2=260431&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=260431&r1=260430&r2=260431&view=diff</a><br>
> ==============================================================================<br>
> --- libcxx/trunk/include/__config (original)<br>
> +++ libcxx/trunk/include/__config Wed Feb 10 14:46:23 2016<br>
> @@ -42,6 +42,7 @@<br>
>  // Fix undefined behavior in how std::list stores it's linked nodes.<br>
>  #define _LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB<br>
>  #define _LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB<br>
> +#define _LIBCPP_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE<br>
>  #endif<br>
><br>
>  #define _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_X##_LIBCPP_Y<br>
><br>
> Modified: libcxx/trunk/include/__hash_table<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__hash_table?rev=260431&r1=260430&r2=260431&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__hash_table?rev=260431&r1=260430&r2=260431&view=diff</a><br>
> ==============================================================================<br>
> --- libcxx/trunk/include/__hash_table (original)<br>
> +++ libcxx/trunk/include/__hash_table Wed Feb 10 14:46:23 2016<br>
> @@ -17,6 +17,7 @@<br>
>  #include <iterator><br>
>  #include <algorithm><br>
>  #include <cmath><br>
> +#include <utility><br>
><br>
>  #include <__undef_min_max><br>
>  #include <__undef___deallocate><br>
> @@ -49,10 +50,10 @@ struct __hash_node<br>
>                   typename __rebind_pointer<_VoidPtr, __hash_node<_Tp, _VoidPtr> >::type<br>
>               ><br>
>  {<br>
> -    typedef _Tp value_type;<br>
> +    typedef _Tp __node_value_type;<br>
><br>
>      size_t     __hash_;<br>
> -    value_type __value_;<br>
> +    __node_value_type __value_;<br>
>  };<br>
><br>
>  inline _LIBCPP_INLINE_VISIBILITY<br>
> @@ -77,23 +78,126 @@ __next_hash_pow2(size_t __n)<br>
>  }<br>
><br>
>  template <class _Tp, class _Hash, class _Equal, class _Alloc> class __hash_table;<br>
> +<br>
> +template <class _NodePtr>      class _LIBCPP_TYPE_VIS_ONLY __hash_iterator;<br>
>  template <class _ConstNodePtr> class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator;<br>
> +template <class _NodePtr>      class _LIBCPP_TYPE_VIS_ONLY __hash_local_iterator;<br>
> +template <class _ConstNodePtr> class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator;<br>
>  template <class _HashIterator> class _LIBCPP_TYPE_VIS_ONLY __hash_map_iterator;<br>
>  template <class _HashIterator> class _LIBCPP_TYPE_VIS_ONLY __hash_map_const_iterator;<br>
><br>
> +#if __cplusplus >= 201103L<br>
> +template <class _Key, class _Tp><br>
> +union __hash_value_type;<br>
> +#else<br>
> +template <class _Key, class _Tp><br>
> +struct __hash_value_type;<br>
> +#endif<br>
> +<br>
> +template <class _Tp><br>
> +struct __key_value_types {<br>
> +  static_assert(!is_reference<_Tp>::value && !is_const<_Tp>::value, "");<br>
> +  typedef _Tp key_type;<br>
> +  typedef _Tp __node_value_type;<br>
> +  typedef _Tp __container_value_type;<br>
> +  static const bool __is_map = false;<br>
> +};<br>
> +<br>
> +template <class _Key, class _Tp><br>
> +struct __key_value_types<__hash_value_type<_Key, _Tp> > {<br>
> +  typedef _Key                                         key_type;<br>
> +  typedef _Tp                                          mapped_type;<br>
> +  typedef __hash_value_type<_Key, _Tp>                 __node_value_type;<br>
> +  typedef pair<const _Key, _Tp>                        __container_value_type;<br>
> +  typedef __container_value_type                       __map_value_type;<br>
> +  static const bool __is_map = true;<br>
> +};<br>
> +<br>
> +template <class _Tp, class _AllocPtr, class _KVTypes = __key_value_types<_Tp>,<br>
> +          bool = _KVTypes::__is_map><br>
> +struct __map_pointer_types {};<br>
> +<br>
> +template <class _Tp, class _AllocPtr, class _KVTypes><br>
> +struct __map_pointer_types<_Tp, _AllocPtr, _KVTypes, true> {<br>
> +  typedef typename _KVTypes::__map_value_type   _Mv;<br>
> +  typedef typename __rebind_pointer<_AllocPtr, _Mv>::type<br>
> +                                                       __map_value_type_pointer;<br>
> +  typedef typename __rebind_pointer<_AllocPtr, const _Mv>::type<br>
> +                                                 __const_map_value_type_pointer;<br>
> +};<br>
> +<br>
> +template <class _NodePtr, class _NodeT = typename pointer_traits<_NodePtr>::element_type><br>
> +struct __hash_node_types;<br>
> +<br>
> +template <class _NodePtr, class _Tp, class _VoidPtr><br>
> +struct __hash_node_types<_NodePtr, __hash_node<_Tp, _VoidPtr> ><br>
> +    : public __key_value_types<_Tp>, __map_pointer_types<_Tp, _VoidPtr><br>
> +<br>
> +{<br>
> +  typedef __key_value_types<_Tp>           __base;<br>
> +<br>
> +public:<br>
> +  typedef ptrdiff_t difference_type;<br>
> +  typedef size_t size_type;<br>
> +<br>
> +  typedef typename __rebind_pointer<_NodePtr, void>::type       __void_pointer;<br>
> +<br>
> +  typedef typename pointer_traits<_NodePtr>::element_type       __node_type;<br>
> +  typedef _NodePtr                                              __node_pointer;<br>
> +<br>
> +  typedef __hash_node_base<__node_pointer>                      __node_base_type;<br>
> +  typedef typename __rebind_pointer<_NodePtr, __node_base_type>::type<br>
> +                                                             __node_base_pointer;<br>
> +<br>
> +  typedef _Tp                                                 __node_value_type;<br>
> +  typedef typename __rebind_pointer<_VoidPtr, __node_value_type>::type<br>
> +                                                      __node_value_type_pointer;<br>
> +  typedef typename __rebind_pointer<_VoidPtr, const __node_value_type>::type<br>
> +                                                __const_node_value_type_pointer;<br>
> +private:<br>
> +    static_assert(!is_const<__node_type>::value,<br>
> +                "_NodePtr should never be a pointer to const");<br>
> +    static_assert((is_same<typename pointer_traits<_VoidPtr>::element_type, void>::value),<br>
> +                  "_VoidPtr does not point to unqualified void type");<br>
> +    static_assert((is_same<typename __rebind_pointer<_VoidPtr, __node_type>::type,<br>
> +                          _NodePtr>::value), "_VoidPtr does not rebind to _NodePtr.");<br>
> +};<br>
> +<br>
> +<br>
> +<br>
> +template <class _HashIterator><br>
> +struct __hash_node_types_from_iterator;<br>
> +template <class _NodePtr><br>
> +struct __hash_node_types_from_iterator<__hash_iterator<_NodePtr> > : __hash_node_types<_NodePtr> {};<br>
> +template <class _NodePtr><br>
> +struct __hash_node_types_from_iterator<__hash_const_iterator<_NodePtr> > : __hash_node_types<_NodePtr> {};<br>
> +template <class _NodePtr><br>
> +struct __hash_node_types_from_iterator<__hash_local_iterator<_NodePtr> > : __hash_node_types<_NodePtr> {};<br>
> +template <class _NodePtr><br>
> +struct __hash_node_types_from_iterator<__hash_const_local_iterator<_NodePtr> > : __hash_node_types<_NodePtr> {};<br>
> +<br>
> +<br>
> +template <class _NodeValueTp, class _VoidPtr><br>
> +struct __make_hash_node_types {<br>
> +  typedef __hash_node<_NodeValueTp, _VoidPtr> _NodeTp;<br>
> +  typedef typename __rebind_pointer<_VoidPtr, _NodeTp>::type _NodePtr;<br>
> +  typedef __hash_node_types<_NodePtr> type;<br>
> +};<br>
> +<br>
>  template <class _NodePtr><br>
>  class _LIBCPP_TYPE_VIS_ONLY __hash_iterator<br>
>  {<br>
> -    typedef _NodePtr __node_pointer;<br>
> +    typedef __hash_node_types<_NodePtr> _NodeTypes;<br>
> +    typedef _NodePtr                    __node_pointer;<br>
><br>
>      __node_pointer            __node_;<br>
><br>
>  public:<br>
> -    typedef forward_iterator_tag                         iterator_category;<br>
> -    typedef typename pointer_traits<__node_pointer>::element_type::value_type value_type;<br>
> -    typedef typename pointer_traits<__node_pointer>::difference_type difference_type;<br>
> -    typedef value_type&                                  reference;<br>
> -    typedef typename __rebind_pointer<__node_pointer, value_type>::type pointer;<br>
> +    typedef forward_iterator_tag                           iterator_category;<br>
> +    typedef typename _NodeTypes::__node_value_type         value_type;<br>
> +    typedef typename _NodeTypes::difference_type           difference_type;<br>
> +    typedef value_type&                                    reference;<br>
> +    typedef typename _NodeTypes::__node_value_type_pointer pointer;<br>
><br>
>      _LIBCPP_INLINE_VISIBILITY __hash_iterator() _NOEXCEPT<br>
>  #if _LIBCPP_STD_VER > 11<br>
> @@ -202,25 +306,22 @@ private:<br>
>      template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY unordered_multimap;<br>
>  };<br>
><br>
> -template <class _ConstNodePtr><br>
> +template <class _NodePtr><br>
>  class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator<br>
>  {<br>
> -    typedef _ConstNodePtr __node_pointer;<br>
> -<br>
> -    __node_pointer         __node_;<br>
> -<br>
> -    typedef typename remove_const<<br>
> -        typename pointer_traits<__node_pointer>::element_type<br>
> -                                 >::type __node;<br>
> +    static_assert(!is_const<typename pointer_traits<_NodePtr>::element_type>::value, "");<br>
> +    typedef __hash_node_types<_NodePtr> _NodeTypes;<br>
> +    typedef _NodePtr __node_pointer;<br>
> +    typedef __hash_iterator<_NodePtr> __non_const_iterator;<br>
> +    __node_pointer __node_;<br>
><br>
>  public:<br>
> -    typedef forward_iterator_tag                       iterator_category;<br>
> -    typedef typename __node::value_type                value_type;<br>
> -    typedef typename pointer_traits<__node_pointer>::difference_type difference_type;<br>
> -    typedef const value_type&                          reference;<br>
> -    typedef typename __rebind_pointer<__node_pointer, const value_type>::type pointer;<br>
> -    typedef typename __rebind_pointer<__node_pointer, __node>::type __non_const_node_pointer;<br>
> -    typedef __hash_iterator<__non_const_node_pointer> __non_const_iterator;<br>
> +    typedef forward_iterator_tag                                 iterator_category;<br>
> +    typedef typename _NodeTypes::__node_value_type               value_type;<br>
> +    typedef typename _NodeTypes::difference_type                 difference_type;<br>
> +    typedef const value_type&                                    reference;<br>
> +    typedef typename _NodeTypes::__const_node_value_type_pointer pointer;<br>
> +<br>
><br>
>      _LIBCPP_INLINE_VISIBILITY __hash_const_iterator() _NOEXCEPT<br>
>  #if _LIBCPP_STD_VER > 11<br>
> @@ -336,24 +437,22 @@ private:<br>
>      template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY unordered_multimap;<br>
>  };<br>
><br>
> -template <class _ConstNodePtr> class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator;<br>
> -<br>
>  template <class _NodePtr><br>
>  class _LIBCPP_TYPE_VIS_ONLY __hash_local_iterator<br>
>  {<br>
> -    typedef _NodePtr __node_pointer;<br>
> +    typedef __hash_node_types<_NodePtr> _NodeTypes;<br>
> +    typedef _NodePtr                    __node_pointer;<br>
><br>
>      __node_pointer         __node_;<br>
>      size_t                 __bucket_;<br>
>      size_t                 __bucket_count_;<br>
><br>
> -    typedef pointer_traits<__node_pointer>          __pointer_traits;<br>
>  public:<br>
>      typedef forward_iterator_tag                                iterator_category;<br>
> -    typedef typename __pointer_traits::element_type::value_type value_type;<br>
> -    typedef typename __pointer_traits::difference_type          difference_type;<br>
> +    typedef typename _NodeTypes::__node_value_type              value_type;<br>
> +    typedef typename _NodeTypes::difference_type                difference_type;<br>
>      typedef value_type&                                         reference;<br>
> -    typedef typename __rebind_pointer<__node_pointer, value_type>::type pointer;<br>
> +    typedef typename _NodeTypes::__node_value_type_pointer      pointer;<br>
><br>
>      _LIBCPP_INLINE_VISIBILITY __hash_local_iterator() _NOEXCEPT<br>
>      {<br>
> @@ -476,7 +575,8 @@ private:<br>
>  template <class _ConstNodePtr><br>
>  class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator<br>
>  {<br>
> -    typedef _ConstNodePtr __node_pointer;<br>
> +    typedef __hash_node_types<_ConstNodePtr> _NodeTypes;<br>
> +    typedef _ConstNodePtr                    __node_pointer;<br>
><br>
>      __node_pointer         __node_;<br>
>      size_t                 __bucket_;<br>
> @@ -491,14 +591,11 @@ class _LIBCPP_TYPE_VIS_ONLY __hash_const<br>
>      typedef __hash_local_iterator<__non_const_node_pointer><br>
>                                                      __non_const_iterator;<br>
>  public:<br>
> -    typedef forward_iterator_tag                       iterator_category;<br>
> -    typedef typename remove_const<<br>
> -                        typename __pointer_traits::element_type::value_type<br>
> -                     >::type                           value_type;<br>
> -    typedef typename __pointer_traits::difference_type difference_type;<br>
> -    typedef const value_type&                          reference;<br>
> -    typedef typename __rebind_pointer<__node_pointer, const value_type>::type<br>
> -        pointer;<br>
> +    typedef forward_iterator_tag                                 iterator_category;<br>
> +    typedef typename _NodeTypes::__node_value_type               value_type;<br>
> +    typedef typename _NodeTypes::difference_type                 difference_type;<br>
> +    typedef const value_type&                                    reference;<br>
> +    typedef typename _NodeTypes::__const_node_value_type_pointer pointer;<br>
><br>
><br>
>      _LIBCPP_INLINE_VISIBILITY __hash_const_local_iterator() _NOEXCEPT<br>
> @@ -686,7 +783,7 @@ class __hash_node_destructor<br>
>  {<br>
>      typedef _Alloc                                          allocator_type;<br>
>      typedef allocator_traits<allocator_type>                __alloc_traits;<br>
> -    typedef typename __alloc_traits::value_type::value_type value_type;<br>
> +<br>
>  public:<br>
>      typedef typename __alloc_traits::pointer                pointer;<br>
>  private:<br>
> @@ -728,23 +825,42 @@ public:<br>
><br>
>  private:<br>
>      typedef allocator_traits<allocator_type> __alloc_traits;<br>
> +    typedef typename<br>
> +      __make_hash_node_types<value_type, typename __alloc_traits::void_pointer>::type<br>
> +                                                                     _NodeTypes;<br>
>  public:<br>
>      typedef value_type&                              reference;<br>
>      typedef const value_type&                        const_reference;<br>
>      typedef typename __alloc_traits::pointer         pointer;<br>
>      typedef typename __alloc_traits::const_pointer   const_pointer;<br>
> +#ifndef _LIBCPP_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE<br>
>      typedef typename __alloc_traits::size_type       size_type;<br>
> -    typedef typename __alloc_traits::difference_type difference_type;<br>
> +#else<br>
> +    typedef typename _NodeTypes::size_type           size_type;<br>
> +#endif<br>
> +    typedef typename _NodeTypes::difference_type     difference_type;<br>
>  public:<br>
>      // Create __node<br>
> -    typedef __hash_node<value_type, typename __alloc_traits::void_pointer> __node;<br>
> +<br>
> +    typedef typename _NodeTypes::__node_type __node;<br>
>      typedef typename __rebind_alloc_helper<__alloc_traits, __node>::type __node_allocator;<br>
>      typedef allocator_traits<__node_allocator>       __node_traits;<br>
> -    typedef typename __node_traits::pointer          __node_pointer;<br>
> -    typedef typename __node_traits::pointer          __node_const_pointer;<br>
> -    typedef __hash_node_base<__node_pointer>         __first_node;<br>
> -    typedef typename __rebind_pointer<__node_pointer, __first_node>::type<br>
> -        __node_base_pointer;<br>
> +    typedef typename _NodeTypes::__node_pointer      __node_pointer;<br>
> +    typedef typename _NodeTypes::__node_pointer      __node_const_pointer;<br>
> +    typedef typename _NodeTypes::__node_base_type    __first_node;<br>
> +    typedef typename _NodeTypes::__node_base_pointer __node_base_pointer;<br>
> +<br>
> +private:<br>
> +    // check for sane allocator pointer rebinding semantics. Rebinding the<br>
> +    // allocator for a new pointer type should be exactly the same as rebinding<br>
> +    // the pointer using 'pointer_traits'.<br>
> +    static_assert((is_same<__node_pointer, typename __node_traits::pointer>::value),<br>
> +                  "Allocator does not rebind pointers in a sane manner.");<br>
> +    typedef typename __rebind_alloc_helper<__node_traits, __first_node>::type<br>
> +        __node_base_allocator;<br>
> +    typedef allocator_traits<__node_base_allocator> __node_base_traits;<br>
> +    static_assert((is_same<__node_base_pointer, typename __node_base_traits::pointer>::value),<br>
> +                 "Allocator does not rebind pointers in a sane manner.");<br>
><br>
>  private:<br>
><br>
> @@ -755,10 +871,10 @@ private:<br>
>      typedef typename __bucket_list_deleter::pointer __node_pointer_pointer;<br>
><br>
>      // --- Member data begin ---<br>
> -    __bucket_list                                     __bucket_list_;<br>
> -    __compressed_pair<__first_node, __node_allocator> __p1_;<br>
> -    __compressed_pair<size_type, hasher>              __p2_;<br>
> -    __compressed_pair<float, key_equal>               __p3_;<br>
> +    __bucket_list                                         __bucket_list_;<br>
> +    __compressed_pair<__first_node, __node_allocator>     __p1_;<br>
> +    __compressed_pair<size_type, hasher>                  __p2_;<br>
> +    __compressed_pair<float, key_equal>                   __p3_;<br>
>      // --- Member data end ---<br>
><br>
>      _LIBCPP_INLINE_VISIBILITY<br>
><br>
> Modified: libcxx/trunk/include/ext/hash_map<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/ext/hash_map?rev=260431&r1=260430&r2=260431&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/ext/hash_map?rev=260431&r1=260430&r2=260431&view=diff</a><br>
> ==============================================================================<br>
> --- libcxx/trunk/include/ext/hash_map (original)<br>
> +++ libcxx/trunk/include/ext/hash_map Wed Feb 10 14:46:23 2016<br>
> @@ -309,7 +309,7 @@ class __hash_map_node_destructor<br>
>  {<br>
>      typedef _Alloc                              allocator_type;<br>
>      typedef allocator_traits<allocator_type>    __alloc_traits;<br>
> -    typedef typename __alloc_traits::value_type::value_type value_type;<br>
> +    typedef typename __alloc_traits::value_type::__node_value_type value_type;<br>
>  public:<br>
>      typedef typename __alloc_traits::pointer    pointer;<br>
>  private:<br>
><br>
> Modified: libcxx/trunk/include/unordered_map<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/unordered_map?rev=260431&r1=260430&r2=260431&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/unordered_map?rev=260431&r1=260430&r2=260431&view=diff</a><br>
> ==============================================================================<br>
> --- libcxx/trunk/include/unordered_map (original)<br>
> +++ libcxx/trunk/include/unordered_map Wed Feb 10 14:46:23 2016<br>
> @@ -384,6 +384,7 @@ template <class _Key, class _Cp, class _<br>
>  class __unordered_map_hasher<br>
>      : private _Hash<br>
>  {<br>
> +  typedef typename __key_value_types<_Cp>::__map_value_type _PairT;<br>
>  public:<br>
>      _LIBCPP_INLINE_VISIBILITY<br>
>      __unordered_map_hasher()<br>
> @@ -414,6 +415,7 @@ class __unordered_map_hasher<_Key, _Cp,<br>
>  {<br>
>      _Hash __hash_;<br>
><br>
> +    typedef typename __key_value_types<_Cp>::__map_value_type _PairT;<br>
>  public:<br>
>      _LIBCPP_INLINE_VISIBILITY<br>
>      __unordered_map_hasher()<br>
> @@ -455,6 +457,7 @@ template <class _Key, class _Cp, class _<br>
>  class __unordered_map_equal<br>
>      : private _Pred<br>
>  {<br>
> +   typedef typename __key_value_types<_Cp>::__map_value_type _PairT;<br>
>  public:<br>
>      _LIBCPP_INLINE_VISIBILITY<br>
>      __unordered_map_equal()<br>
> @@ -488,6 +491,7 @@ class __unordered_map_equal<_Key, _Cp, _<br>
>  {<br>
>      _Pred __pred_;<br>
><br>
> +    typedef typename __key_value_types<_Cp>::__map_value_type _PairT;<br>
>  public:<br>
>      _LIBCPP_INLINE_VISIBILITY<br>
>      __unordered_map_equal()<br>
> @@ -508,6 +512,9 @@ public:<br>
>      _LIBCPP_INLINE_VISIBILITY<br>
>      bool operator()(const _Key& __x, const _Cp& __y) const<br>
>          {return __pred_(__x, __y.__cc.first);}<br>
> +  _LIBCPP_INLINE_VISIBILITY<br>
> +    bool operator()(const _Key& __x, const _PairT& __y) const<br>
> +        {return __pred_(__x, __y.first);}<br>
>      void swap(__unordered_map_equal&__y)<br>
>          _NOEXCEPT_(__is_nothrow_swappable<_Pred>::value)<br>
>      {<br>
> @@ -531,12 +538,11 @@ class __hash_map_node_destructor<br>
>  {<br>
>      typedef _Alloc                              allocator_type;<br>
>      typedef allocator_traits<allocator_type>    __alloc_traits;<br>
> -    typedef typename __alloc_traits::value_type::value_type value_type;<br>
> +<br>
>  public:<br>
> -    typedef typename __alloc_traits::pointer    pointer;<br>
> +<br>
> +    typedef typename __alloc_traits::pointer       pointer;<br>
>  private:<br>
> -    typedef typename value_type::value_type::first_type     first_type;<br>
> -    typedef typename value_type::value_type::second_type    second_type;<br>
><br>
>      allocator_type& __na_;<br>
><br>
> @@ -656,15 +662,14 @@ class _LIBCPP_TYPE_VIS_ONLY __hash_map_i<br>
>  {<br>
>      _HashIterator __i_;<br>
><br>
> -    typedef const typename _HashIterator::value_type::value_type::first_type key_type;<br>
> -    typedef typename _HashIterator::value_type::value_type::second_type      mapped_type;<br>
> +    typedef  __hash_node_types_from_iterator<_HashIterator> _NodeTypes;<br>
> +<br>
>  public:<br>
>      typedef forward_iterator_tag                                 iterator_category;<br>
> -    typedef pair<key_type, mapped_type>                          value_type;<br>
> -    typedef typename _HashIterator::difference_type              difference_type;<br>
> +    typedef typename _NodeTypes::__map_value_type                value_type;<br>
> +    typedef typename _NodeTypes::difference_type                 difference_type;<br>
>      typedef value_type&                                          reference;<br>
> -    typedef typename __rebind_pointer<typename _HashIterator::pointer, value_type>::type<br>
> -        pointer;<br>
> +    typedef typename _NodeTypes::__map_value_type_pointer       pointer;<br>
><br>
>      _LIBCPP_INLINE_VISIBILITY<br>
>      __hash_map_iterator() _NOEXCEPT {}<br>
> @@ -706,15 +711,14 @@ class _LIBCPP_TYPE_VIS_ONLY __hash_map_c<br>
>  {<br>
>      _HashIterator __i_;<br>
><br>
> -    typedef const typename _HashIterator::value_type::value_type::first_type key_type;<br>
> -    typedef typename _HashIterator::value_type::value_type::second_type      mapped_type;<br>
> +    typedef  __hash_node_types_from_iterator<_HashIterator> _NodeTypes;<br>
> +<br>
>  public:<br>
>      typedef forward_iterator_tag                                 iterator_category;<br>
> -    typedef pair<key_type, mapped_type>                          value_type;<br>
> -    typedef typename _HashIterator::difference_type              difference_type;<br>
> +    typedef typename _NodeTypes::__map_value_type                value_type;<br>
> +    typedef typename _NodeTypes::difference_type                 difference_type;<br>
>      typedef const value_type&                                    reference;<br>
> -    typedef typename __rebind_pointer<typename _HashIterator::pointer, const value_type>::type<br>
> -        pointer;<br>
> +    typedef typename _NodeTypes::__const_map_value_type_pointer  pointer;<br>
><br>
>      _LIBCPP_INLINE_VISIBILITY<br>
>      __hash_map_const_iterator() _NOEXCEPT {}<br>
> @@ -796,8 +800,8 @@ private:<br>
>  public:<br>
>      typedef typename __alloc_traits::pointer         pointer;<br>
>      typedef typename __alloc_traits::const_pointer   const_pointer;<br>
> -    typedef typename __alloc_traits::size_type       size_type;<br>
> -    typedef typename __alloc_traits::difference_type difference_type;<br>
> +    typedef typename __table::size_type              size_type;<br>
> +    typedef typename __table::difference_type        difference_type;<br>
><br>
>      typedef __hash_map_iterator<typename __table::iterator>       iterator;<br>
>      typedef __hash_map_const_iterator<typename __table::const_iterator> const_iterator;<br>
> @@ -1641,11 +1645,14 @@ private:<br>
>      typedef __hash_map_node_destructor<__node_allocator>   _Dp;<br>
>      typedef unique_ptr<__node, _Dp>                         __node_holder;<br>
>      typedef allocator_traits<allocator_type>               __alloc_traits;<br>
> +    static_assert((is_same<typename __node_traits::size_type,<br>
> +                          typename __alloc_traits::size_type>::value),<br>
> +                 "Allocator uses different size_type for different types");<br>
>  public:<br>
>      typedef typename __alloc_traits::pointer         pointer;<br>
>      typedef typename __alloc_traits::const_pointer   const_pointer;<br>
> -    typedef typename __alloc_traits::size_type       size_type;<br>
> -    typedef typename __alloc_traits::difference_type difference_type;<br>
> +    typedef typename __table::size_type              size_type;<br>
> +    typedef typename __table::difference_type        difference_type;<br>
><br>
>      typedef __hash_map_iterator<typename __table::iterator>       iterator;<br>
>      typedef __hash_map_const_iterator<typename __table::const_iterator> const_iterator;<br>
><br>
> Added: libcxx/trunk/test/libcxx/containers/unord/key_value_traits.pass.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/unord/key_value_traits.pass.cpp?rev=260431&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/unord/key_value_traits.pass.cpp?rev=260431&view=auto</a><br>
> ==============================================================================<br>
> --- libcxx/trunk/test/libcxx/containers/unord/key_value_traits.pass.cpp (added)<br>
> +++ libcxx/trunk/test/libcxx/containers/unord/key_value_traits.pass.cpp Wed Feb 10 14:46:23 2016<br>
> @@ -0,0 +1,59 @@<br>
> +//===----------------------------------------------------------------------===//<br>
> +//<br>
> +//                     The LLVM Compiler Infrastructure<br>
> +//<br>
> +// This file is dual licensed under the MIT and the University of Illinois Open<br>
> +// Source Licenses. See LICENSE.TXT for details.<br>
> +//<br>
> +//===----------------------------------------------------------------------===//<br>
> +<br>
> +#include <__hash_table><br>
> +#include <unordered_map><br>
> +#include <unordered_set><br>
> +#include <type_traits><br>
> +<br>
> +#include "test_macros.h"<br>
> +#include "min_allocator.h"<br>
> +<br>
> +void testKeyValueTrait() {<br>
> +  {<br>
> +    typedef int Tp;<br>
> +    typedef std::__key_value_types<Tp> Traits;<br>
> +    static_assert((std::is_same<Traits::key_type, int>::value), "");<br>
> +    static_assert((std::is_same<Traits::__node_value_type, Tp>::value), "");<br>
> +    static_assert((std::is_same<Traits::__container_value_type, Tp>::value), "");<br>
> +    static_assert(Traits::__is_map == false, "");<br>
> +  }<br>
> +  {<br>
> +    typedef std::pair<int, int> Tp;<br>
> +    typedef std::__key_value_types<Tp> Traits;<br>
> +    static_assert((std::is_same<Traits::key_type, Tp>::value), "");<br>
> +    static_assert((std::is_same<Traits::__node_value_type, Tp>::value), "");<br>
> +    static_assert((std::is_same<Traits::__container_value_type, Tp>::value), "");<br>
> +    static_assert(Traits::__is_map == false, "");<br>
> +  }<br>
> +  {<br>
> +    typedef std::pair<const int, int> Tp;<br>
> +    typedef std::__key_value_types<Tp> Traits;<br>
> +    static_assert((std::is_same<Traits::key_type, Tp>::value), "");<br>
> +    static_assert((std::is_same<Traits::__node_value_type, Tp>::value), "");<br>
> +    static_assert((std::is_same<Traits::__container_value_type, Tp>::value), "");<br>
> +    static_assert(Traits::__is_map == false, "");<br>
> +  }<br>
> +  {<br>
> +    typedef std::__hash_value_type<int, int> Tp;<br>
> +    typedef std::__key_value_types<Tp> Traits;<br>
> +    static_assert((std::is_same<Traits::key_type, int>::value), "");<br>
> +    static_assert((std::is_same<Traits::mapped_type, int>::value), "");<br>
> +    static_assert((std::is_same<Traits::__node_value_type, Tp>::value), "");<br>
> +    static_assert((std::is_same<Traits::__container_value_type,<br>
> +                               std::pair<const int, int> >::value), "");<br>
> +    static_assert((std::is_same<Traits::__map_value_type,<br>
> +                               std::pair<const int, int> >::value), "");<br>
> +    static_assert(Traits::__is_map == true, "");<br>
> +  }<br>
> +}<br>
> +<br>
> +int main() {<br>
> +  testKeyValueTrait();<br>
> +}<br>
><br>
> Added: libcxx/trunk/test/std/containers/unord/iterator_difference_type.pass.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/iterator_difference_type.pass.cpp?rev=260431&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/iterator_difference_type.pass.cpp?rev=260431&view=auto</a><br>
> ==============================================================================<br>
> --- libcxx/trunk/test/std/containers/unord/iterator_difference_type.pass.cpp (added)<br>
> +++ libcxx/trunk/test/std/containers/unord/iterator_difference_type.pass.cpp Wed Feb 10 14:46:23 2016<br>
> @@ -0,0 +1,154 @@<br>
> +//===----------------------------------------------------------------------===//<br>
> +//<br>
> +//                     The LLVM Compiler Infrastructure<br>
> +//<br>
> +// This file is dual licensed under the MIT and the University of Illinois Open<br>
> +// Source Licenses. See LICENSE.TXT for details.<br>
> +//<br>
> +//===----------------------------------------------------------------------===//<br>
> +<br>
> +#include <unordered_map><br>
> +#include <unordered_set><br>
> +#include <type_traits><br>
> +<br>
> +#include "test_macros.h"<br>
> +#include "min_allocator.h"<br>
> +#include "test_allocator.h"<br>
> +<br>
> +<br>
> +template <class Map, class ValueTp, class PtrT, class CPtrT><br>
> +void testUnorderedMap() {<br>
> +  typedef typename Map::difference_type Diff;<br>
> +  {<br>
> +    typedef typename Map::iterator It;<br>
> +    static_assert((std::is_same<typename It::value_type, ValueTp>::value), "");<br>
> +    static_assert((std::is_same<typename It::reference, ValueTp&>::value), "");<br>
> +    static_assert((std::is_same<typename It::pointer, PtrT>::value), "");<br>
> +    static_assert((std::is_same<typename It::difference_type, Diff>::value), "");<br>
> +  }<br>
> +  {<br>
> +    typedef typename Map::const_iterator It;<br>
> +    static_assert((std::is_same<typename It::value_type, ValueTp>::value), "");<br>
> +    static_assert((std::is_same<typename It::reference, ValueTp const&>::value), "");<br>
> +    static_assert((std::is_same<typename It::pointer, CPtrT>::value), "");<br>
> +    static_assert((std::is_same<typename It::difference_type, Diff>::value), "");<br>
> +  }<br>
> +  {<br>
> +    typedef typename Map::local_iterator It;<br>
> +    static_assert((std::is_same<typename It::value_type, ValueTp>::value), "");<br>
> +    static_assert((std::is_same<typename It::reference, ValueTp&>::value), "");<br>
> +    static_assert((std::is_same<typename It::pointer, PtrT>::value), "");<br>
> +    static_assert((std::is_same<typename It::difference_type, Diff>::value), "");<br>
> +  }<br>
> +  {<br>
> +    typedef typename Map::const_local_iterator It;<br>
> +    static_assert((std::is_same<typename It::value_type, ValueTp>::value), "");<br>
> +    static_assert((std::is_same<typename It::reference, ValueTp const&>::value), "");<br>
> +    static_assert((std::is_same<typename It::pointer, CPtrT>::value), "");<br>
> +    static_assert((std::is_same<typename It::difference_type, Diff>::value), "");<br>
> +  }<br>
> +}<br>
> +<br>
> +<br>
> +template <class Set, class ValueTp, class CPtrT><br>
> +void testUnorderedSet() {<br>
> +  static_assert((std::is_same<typename Set::iterator,<br>
> +                             typename Set::const_iterator>::value), "");<br>
> +  static_assert((std::is_same<typename Set::local_iterator,<br>
> +                             typename Set::const_local_iterator>::value), "");<br>
> +  typedef typename Set::difference_type Diff;<br>
> +  {<br>
> +    typedef typename Set::iterator It;<br>
> +    static_assert((std::is_same<typename It::value_type, ValueTp>::value), "");<br>
> +    static_assert((std::is_same<typename It::reference, ValueTp const&>::value), "");<br>
> +    static_assert((std::is_same<typename It::pointer, CPtrT>::value), "");<br>
> +    static_assert((std::is_same<typename It::difference_type, Diff>::value), "");<br>
> +<br>
> +  }<br>
> +  {<br>
> +    typedef typename Set::local_iterator It;<br>
> +    static_assert((std::is_same<typename It::value_type, ValueTp>::value), "");<br>
> +    static_assert((std::is_same<typename It::reference, ValueTp const&>::value), "");<br>
> +    static_assert((std::is_same<typename It::pointer, CPtrT>::value), "");<br>
> +    static_assert((std::is_same<typename It::difference_type, Diff>::value), "");<br>
> +  }<br>
> +}<br>
> +<br>
> +int main() {<br>
> +  {<br>
> +    typedef std::unordered_map<int, int> Map;<br>
> +    typedef std::pair<const int, int> ValueTp;<br>
> +    testUnorderedMap<Map, ValueTp, ValueTp*, ValueTp const*>();<br>
> +  }<br>
> +  {<br>
> +    typedef std::pair<const int, int> ValueTp;<br>
> +    typedef test_allocator<ValueTp> Alloc;<br>
> +    typedef std::unordered_map<int, int, std::hash<int>, std::equal_to<int>, Alloc> Map;<br>
> +    testUnorderedMap<Map, ValueTp, ValueTp*, ValueTp const*>();<br>
> +  }<br>
> +#if TEST_STD_VER >= 11<br>
> +  {<br>
> +    typedef std::pair<const int, int> ValueTp;<br>
> +    typedef min_allocator<ValueTp> Alloc;<br>
> +    typedef std::unordered_map<int, int, std::hash<int>, std::equal_to<int>, Alloc> Map;<br>
> +    testUnorderedMap<Map, ValueTp, min_pointer<ValueTp>, min_pointer<const ValueTp>>();<br>
> +  }<br>
> +#endif<br>
> +  {<br>
> +    typedef std::unordered_multimap<int, int> Map;<br>
> +    typedef std::pair<const int, int> ValueTp;<br>
> +    testUnorderedMap<Map, ValueTp, ValueTp*, ValueTp const*>();<br>
> +  }<br>
> +  {<br>
> +    typedef std::pair<const int, int> ValueTp;<br>
> +    typedef test_allocator<ValueTp> Alloc;<br>
> +    typedef std::unordered_multimap<int, int, std::hash<int>, std::equal_to<int>, Alloc> Map;<br>
> +    testUnorderedMap<Map, ValueTp, ValueTp*, ValueTp const*>();<br>
> +  }<br>
> +#if TEST_STD_VER >= 11<br>
> +  {<br>
> +    typedef std::pair<const int, int> ValueTp;<br>
> +    typedef min_allocator<ValueTp> Alloc;<br>
> +    typedef std::unordered_multimap<int, int, std::hash<int>, std::equal_to<int>, Alloc> Map;<br>
> +    testUnorderedMap<Map, ValueTp, min_pointer<ValueTp>, min_pointer<const ValueTp>>();<br>
> +  }<br>
> +#endif<br>
> +  {<br>
> +    typedef int ValueTp;<br>
> +    typedef std::unordered_set<ValueTp> Set;<br>
> +    testUnorderedSet<Set, ValueTp, ValueTp const*>();<br>
> +  }<br>
> +  {<br>
> +    typedef int ValueTp;<br>
> +    typedef test_allocator<ValueTp> Alloc;<br>
> +    typedef std::unordered_set<ValueTp, std::hash<ValueTp>, std::equal_to<ValueTp>, Alloc> Set;<br>
> +    testUnorderedSet<Set, ValueTp, ValueTp const*>();<br>
> +  }<br>
> +#if TEST_STD_VER >= 11<br>
> +  {<br>
> +    typedef int ValueTp;<br>
> +    typedef min_allocator<ValueTp> Alloc;<br>
> +    typedef std::unordered_set<ValueTp, std::hash<ValueTp>, std::equal_to<ValueTp>, Alloc> Set;<br>
> +    testUnorderedSet<Set, ValueTp, min_pointer<const ValueTp>>();<br>
> +  }<br>
> +#endif<br>
> +  {<br>
> +    typedef int ValueTp;<br>
> +    typedef std::unordered_multiset<ValueTp> Set;<br>
> +    testUnorderedSet<Set, ValueTp, ValueTp const*>();<br>
> +  }<br>
> +  {<br>
> +    typedef int ValueTp;<br>
> +    typedef test_allocator<ValueTp> Alloc;<br>
> +    typedef std::unordered_multiset<ValueTp, std::hash<ValueTp>, std::equal_to<ValueTp>, Alloc> Set;<br>
> +    testUnorderedSet<Set, ValueTp, ValueTp const*>();<br>
> +  }<br>
> +#if TEST_STD_VER >= 11<br>
> +  {<br>
> +    typedef int ValueTp;<br>
> +    typedef min_allocator<ValueTp> Alloc;<br>
> +    typedef std::unordered_multiset<ValueTp, std::hash<ValueTp>, std::equal_to<ValueTp>, Alloc> Set;<br>
> +    testUnorderedSet<Set, ValueTp, min_pointer<const ValueTp>>();<br>
> +  }<br>
> +#endif<br>
> +}<br>
><br>
> Added: libcxx/trunk/test/std/containers/unord/unord.map/incomplete_type.pass.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.map/incomplete_type.pass.cpp?rev=260431&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.map/incomplete_type.pass.cpp?rev=260431&view=auto</a><br>
> ==============================================================================<br>
> --- libcxx/trunk/test/std/containers/unord/unord.map/incomplete_type.pass.cpp (added)<br>
> +++ libcxx/trunk/test/std/containers/unord/unord.map/incomplete_type.pass.cpp Wed Feb 10 14:46:23 2016<br>
> @@ -0,0 +1,37 @@<br>
> +<br>
> +//===----------------------------------------------------------------------===//<br>
> +//<br>
> +//                     The LLVM Compiler Infrastructure<br>
> +//<br>
> +// This file is dual licensed under the MIT and the University of Illinois Open<br>
> +// Source Licenses. See LICENSE.TXT for details.<br>
> +//<br>
> +//===----------------------------------------------------------------------===//<br>
> +<br>
> +// <unordered_map><br>
> +<br>
> +// Check that std::unordered_map and it's iterators can be instantiated with an incomplete<br>
> +// type.<br>
> +<br>
> +#include <unordered_map><br>
> +<br>
> +template <class Tp><br>
> +struct MyHash {<br>
> +  MyHash() {}<br>
> +  std::size_t operator()(Tp const&) const {return 42;}<br>
> +};<br>
> +<br>
> +struct A {<br>
> +    typedef std::unordered_map<A, A, MyHash<A> > Map;<br>
> +    Map m;<br>
> +    Map::iterator it;<br>
> +    Map::const_iterator cit;<br>
> +    Map::local_iterator lit;<br>
> +    Map::const_local_iterator clit;<br>
> +};<br>
> +<br>
> +inline bool operator==(A const& L, A const& R) { return &L == &R; }<br>
> +<br>
> +int main() {<br>
> +    A a;<br>
> +}<br>
><br>
> Added: libcxx/trunk/test/std/containers/unord/unord.multimap/incomplete.pass.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multimap/incomplete.pass.cpp?rev=260431&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multimap/incomplete.pass.cpp?rev=260431&view=auto</a><br>
> ==============================================================================<br>
> --- libcxx/trunk/test/std/containers/unord/unord.multimap/incomplete.pass.cpp (added)<br>
> +++ libcxx/trunk/test/std/containers/unord/unord.multimap/incomplete.pass.cpp Wed Feb 10 14:46:23 2016<br>
> @@ -0,0 +1,37 @@<br>
> +<br>
> +//===----------------------------------------------------------------------===//<br>
> +//<br>
> +//                     The LLVM Compiler Infrastructure<br>
> +//<br>
> +// This file is dual licensed under the MIT and the University of Illinois Open<br>
> +// Source Licenses. See LICENSE.TXT for details.<br>
> +//<br>
> +//===----------------------------------------------------------------------===//<br>
> +<br>
> +// <unordered_map><br>
> +<br>
> +// Check that std::unordered_multimap and it's iterators can be instantiated with an incomplete<br>
> +// type.<br>
> +<br>
> +#include <unordered_map><br>
> +<br>
> +template <class Tp><br>
> +struct MyHash {<br>
> +  MyHash() {}<br>
> +  std::size_t operator()(Tp const&) const {return 42;}<br>
> +};<br>
> +<br>
> +struct A {<br>
> +    typedef std::unordered_multimap<A, A, MyHash<A> > Map;<br>
> +    Map m;<br>
> +    Map::iterator it;<br>
> +    Map::const_iterator cit;<br>
> +    Map::local_iterator lit;<br>
> +    Map::const_local_iterator clit;<br>
> +};<br>
> +<br>
> +inline bool operator==(A const& L, A const& R) { return &L == &R; }<br>
> +<br>
> +int main() {<br>
> +    A a;<br>
> +}<br>
><br>
> Added: libcxx/trunk/test/std/containers/unord/unord.multiset/incomplete.pass.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/incomplete.pass.cpp?rev=260431&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/incomplete.pass.cpp?rev=260431&view=auto</a><br>
> ==============================================================================<br>
> --- libcxx/trunk/test/std/containers/unord/unord.multiset/incomplete.pass.cpp (added)<br>
> +++ libcxx/trunk/test/std/containers/unord/unord.multiset/incomplete.pass.cpp Wed Feb 10 14:46:23 2016<br>
> @@ -0,0 +1,38 @@<br>
> +<br>
> +<br>
> +//===----------------------------------------------------------------------===//<br>
> +//<br>
> +//                     The LLVM Compiler Infrastructure<br>
> +//<br>
> +// This file is dual licensed under the MIT and the University of Illinois Open<br>
> +// Source Licenses. See LICENSE.TXT for details.<br>
> +//<br>
> +//===----------------------------------------------------------------------===//<br>
> +<br>
> +// <unordered_set><br>
> +<br>
> +// Check that std::unordered_multiset and it's iterators can be instantiated with an incomplete<br>
> +// type.<br>
> +<br>
> +#include <unordered_set><br>
> +<br>
> +template <class Tp><br>
> +struct MyHash {<br>
> +  MyHash() {}<br>
> +  std::size_t operator()(Tp const&) const {return 42;}<br>
> +};<br>
> +<br>
> +struct A {<br>
> +    typedef std::unordered_multiset<A, MyHash<A> > Map;<br>
> +    Map m;<br>
> +    Map::iterator it;<br>
> +    Map::const_iterator cit;<br>
> +    Map::local_iterator lit;<br>
> +    Map::const_local_iterator clit;<br>
> +};<br>
> +<br>
> +inline bool operator==(A const& L, A const& R) { return &L == &R; }<br>
> +<br>
> +int main() {<br>
> +    A a;<br>
> +}<br>
><br>
> Added: libcxx/trunk/test/std/containers/unord/unord.set/incomplete.pass.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/incomplete.pass.cpp?rev=260431&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/incomplete.pass.cpp?rev=260431&view=auto</a><br>
> ==============================================================================<br>
> --- libcxx/trunk/test/std/containers/unord/unord.set/incomplete.pass.cpp (added)<br>
> +++ libcxx/trunk/test/std/containers/unord/unord.set/incomplete.pass.cpp Wed Feb 10 14:46:23 2016<br>
> @@ -0,0 +1,38 @@<br>
> +<br>
> +<br>
> +//===----------------------------------------------------------------------===//<br>
> +//<br>
> +//                     The LLVM Compiler Infrastructure<br>
> +//<br>
> +// This file is dual licensed under the MIT and the University of Illinois Open<br>
> +// Source Licenses. See LICENSE.TXT for details.<br>
> +//<br>
> +//===----------------------------------------------------------------------===//<br>
> +<br>
> +// <unordered_set><br>
> +<br>
> +// Check that std::unordered_set and it's iterators can be instantiated with an incomplete<br>
> +// type.<br>
> +<br>
> +#include <unordered_set><br>
> +<br>
> +template <class Tp><br>
> +struct MyHash {<br>
> +  MyHash() {}<br>
> +  std::size_t operator()(Tp const&) const {return 42;}<br>
> +};<br>
> +<br>
> +struct A {<br>
> +    typedef std::unordered_set<A, MyHash<A> > Map;<br>
> +    Map m;<br>
> +    Map::iterator it;<br>
> +    Map::const_iterator cit;<br>
> +    Map::local_iterator lit;<br>
> +    Map::const_local_iterator clit;<br>
> +};<br>
> +<br>
> +inline bool operator==(A const& L, A const& R) { return &L == &R; }<br>
> +<br>
> +int main() {<br>
> +    A a;<br>
> +}<br>
><br>
><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</div></div></blockquote></div><br></div>