<div dir="ltr">Hopefully fixed in r261180.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 13, 2016 at 2:08 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>
this is my error message:<br>
<br>
In file included from z.cc:1:<br>
/code/build-llvm/bin/../include/c++/v1/ext/hash_map:213:5: warning:<br>
Use of the header <ext/hash_map> is deprecated. Migrate to<br>
<unordered_map> [-W#warnings]<br>
#   warning Use of the header <ext/hash_map> is deprecated.  Migrate<br>
to <unordered_map><br>
    ^<br>
/code/build-llvm/bin/../include/c++/v1/ext/hash_map:432:57: error:<br>
'__non_const_iterator' is a private member of<br>
      'std::__1::__hash_const_iterator<std::__1::__hash_node<std::__1::pair<int,<br>
int>, void *> *>'<br>
            __hash_map_iterator<typename<br>
_HashIterator::__non_const_iterator> __i)<br>
                                                        ^<br>
/code/build-llvm/bin/../include/c++/v1/ext/hash_map:659:16: note: in<br>
instantiation of template class<br>
      '__gnu_cxx::__hash_map_const_iterator<std::__1::__hash_const_iterator<std::__1::__hash_node<std::__1::pair<int,<br>
int>, void *> *> >' requested here<br>
    insert(__u.begin(), __u.end());<br>
               ^<br>
z.cc:4:16: note: in instantiation of member function<br>
'__gnu_cxx::hash_map<int, int, __gnu_cxx::hash<int>,<br>
std::__1::equal_to<int>, std::__1::allocator<std::__1::pair<const<br>
      int, int> > >::hash_map' requested here<br>
template class hash_map<int, int>;<br>
               ^<br>
/code/build-llvm/bin/../include/c++/v1/__hash_table:383:39: note:<br>
implicitly declared private here<br>
    typedef __hash_iterator<_NodePtr> __non_const_iterator;<br>
                                      ^<br>
1 warning and 1 error generated.<br>
<br>
<br>
and this is my test case:<br>
<br>
#include <ext/hash_map><br>
<br>
namespace __gnu_cxx {<br>
template class hash_map<int, int>;<br>
<div class="HOEnZb"><div class="h5">}<br>
<br>
<br>
On Sat, Feb 13, 2016 at 12:17 AM, Eric Fiselier <<a href="mailto:eric@efcs.ca">eric@efcs.ca</a>> wrote:<br>
>> The "hash_map" part of the name means they belong to "<unordered_map>",<br>
>> and the actual type is defined in that header.<br>
><br>
> Woops, Sorry I guess the name is used in both "std::__1::" in unordered_map<br>
> and "__gnu_cxx::" in <ext/hash_map>. My intention in the changes was to<br>
> forward declare "std::__1::__hash_map_iterator".<br>
><br>
> On Sat, Feb 13, 2016 at 1:11 AM, Eric Fiselier <<a href="mailto:eric@efcs.ca">eric@efcs.ca</a>> wrote:<br>
>><br>
>> > hash_map still looks broken to me.<br>
>><br>
>> Uh oh, Sorry :-S. The original breakage was caused by the removal of a<br>
>> typedef "hash_map" used, but I'm sure I fixed that.<br>
>><br>
>> > should not they be prefixed with __gnu_cxx:: ?<br>
>><br>
>> No, they are in the correct namespace. The "hash_map" part of the name<br>
>> means they belong to "<unordered_map>", and the actual type is defined in<br>
>> that header.<br>
>><br>
>> Could you give me more information about the breakage your seeing? The<br>
>> actual compiler diagnostics if possible? I also committed other sizable<br>
>> changes to <__hash_table> in r260513 so that may be related.<br>
>><br>
>> Let me know if you need this reverted. If possible I would like to hold<br>
>> off, at least until more is known.<br>
>><br>
>> /Eric<br>
>><br>
>> On Fri, Feb 12, 2016 at 1:31 PM, Evgenii Stepanov<br>
>> <<a href="mailto:eugeni.stepanov@gmail.com">eugeni.stepanov@gmail.com</a>> wrote:<br>
>>><br>
>>> 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>
>>><br>
>>> template <class _HashIterator> class _LIBCPP_TYPE_VIS_ONLY<br>
>>> __hash_map_iterator;<br>
>>>  template <class _HashIterator> class _LIBCPP_TYPE_VIS_ONLY<br>
>>> __hash_map_const_iterator;<br>
>>><br>
>>> 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>
>>><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<br>
>>> > 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<br>
>>> > EmplaceConstructible<br>
>>> > and CopyInsertable requirements we need to teach __hash_table about<br>
>>> > 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<br>
>>> > 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<br>
>>> > support<br>
>>> > incomplete types.<br>
>>> ><br>
>>> > As a drive-by fix I changed the difference_type in __hash_table to<br>
>>> > always<br>
>>> > be ptrdiff_t. There is a corresponding change to size_type but it<br>
>>> > cannot<br>
>>> > take affect until an ABI break.<br>
>>> ><br>
>>> > This patch will be followed up shortly with fixes for various<br>
>>> > unordered_map<br>
>>> > bugs and problems.<br>
>>> ><br>
>>> > Added:<br>
>>> >     libcxx/trunk/test/libcxx/containers/unord/key_value_traits.pass.cpp<br>
>>> ><br>
>>> > libcxx/trunk/test/std/containers/unord/iterator_difference_type.pass.cpp<br>
>>> ><br>
>>> > libcxx/trunk/test/std/containers/unord/unord.map/incomplete_type.pass.cpp<br>
>>> ><br>
>>> > libcxx/trunk/test/std/containers/unord/unord.multimap/incomplete.pass.cpp<br>
>>> ><br>
>>> > libcxx/trunk/test/std/containers/unord/unord.multiset/incomplete.pass.cpp<br>
>>> ><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:<br>
>>> > <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>
>>> > ==============================================================================<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:<br>
>>> > <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>
>>> > ==============================================================================<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,<br>
>>> > _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<br>
>>> > __hash_table;<br>
>>> > +<br>
>>> > +template <class _NodePtr>      class _LIBCPP_TYPE_VIS_ONLY<br>
>>> > __hash_iterator;<br>
>>> >  template <class _ConstNodePtr> class _LIBCPP_TYPE_VIS_ONLY<br>
>>> > __hash_const_iterator;<br>
>>> > +template <class _NodePtr>      class _LIBCPP_TYPE_VIS_ONLY<br>
>>> > __hash_local_iterator;<br>
>>> > +template <class _ConstNodePtr> class _LIBCPP_TYPE_VIS_ONLY<br>
>>> > __hash_const_local_iterator;<br>
>>> >  template <class _HashIterator> class _LIBCPP_TYPE_VIS_ONLY<br>
>>> > __hash_map_iterator;<br>
>>> >  template <class _HashIterator> class _LIBCPP_TYPE_VIS_ONLY<br>
>>> > __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>
>>> > "");<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><br>
>>> > __node_value_type;<br>
>>> > +  typedef pair<const _Key, _Tp><br>
>>> > __container_value_type;<br>
>>> > +  typedef __container_value_type<br>
>>> > __map_value_type;<br>
>>> > +  static const bool __is_map = true;<br>
>>> > +};<br>
>>> > +<br>
>>> > +template <class _Tp, class _AllocPtr, class _KVTypes =<br>
>>> > __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>
>>> > +<br>
>>> > __map_value_type_pointer;<br>
>>> > +  typedef typename __rebind_pointer<_AllocPtr, const _Mv>::type<br>
>>> > +<br>
>>> > __const_map_value_type_pointer;<br>
>>> > +};<br>
>>> > +<br>
>>> > +template <class _NodePtr, class _NodeT = typename<br>
>>> > 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,<br>
>>> > _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<br>
>>> > __void_pointer;<br>
>>> > +<br>
>>> > +  typedef typename pointer_traits<_NodePtr>::element_type<br>
>>> > __node_type;<br>
>>> > +  typedef _NodePtr<br>
>>> > __node_pointer;<br>
>>> > +<br>
>>> > +  typedef __hash_node_base<__node_pointer><br>
>>> > __node_base_type;<br>
>>> > +  typedef typename __rebind_pointer<_NodePtr, __node_base_type>::type<br>
>>> > +<br>
>>> > __node_base_pointer;<br>
>>> > +<br>
>>> > +  typedef _Tp<br>
>>> > __node_value_type;<br>
>>> > +  typedef typename __rebind_pointer<_VoidPtr, __node_value_type>::type<br>
>>> > +<br>
>>> > __node_value_type_pointer;<br>
>>> > +  typedef typename __rebind_pointer<_VoidPtr, const<br>
>>> > __node_value_type>::type<br>
>>> > +<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<br>
>>> > 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,<br>
>>> > __node_type>::type,<br>
>>> > +                          _NodePtr>::value), "_VoidPtr does not rebind<br>
>>> > 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> > :<br>
>>> > __hash_node_types<_NodePtr> {};<br>
>>> > +template <class _NodePtr><br>
>>> > +struct __hash_node_types_from_iterator<__hash_const_iterator<_NodePtr><br>
>>> > > : __hash_node_types<_NodePtr> {};<br>
>>> > +template <class _NodePtr><br>
>>> > +struct __hash_node_types_from_iterator<__hash_local_iterator<_NodePtr><br>
>>> > > : __hash_node_types<_NodePtr> {};<br>
>>> > +template <class _NodePtr><br>
>>> > +struct<br>
>>> > __hash_node_types_from_iterator<__hash_const_local_iterator<_NodePtr> > :<br>
>>> > __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<br>
>>> > iterator_category;<br>
>>> > -    typedef typename<br>
>>> > pointer_traits<__node_pointer>::element_type::value_type value_type;<br>
>>> > -    typedef typename pointer_traits<__node_pointer>::difference_type<br>
>>> > difference_type;<br>
>>> > -    typedef value_type&                                  reference;<br>
>>> > -    typedef typename __rebind_pointer<__node_pointer,<br>
>>> > value_type>::type pointer;<br>
>>> > +    typedef forward_iterator_tag<br>
>>> > iterator_category;<br>
>>> > +    typedef typename _NodeTypes::__node_value_type         value_type;<br>
>>> > +    typedef typename _NodeTypes::difference_type<br>
>>> > 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<br>
>>> > _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<br>
>>> > 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<br>
>>> > iterator_category;<br>
>>> > -    typedef typename __node::value_type                value_type;<br>
>>> > -    typedef typename pointer_traits<__node_pointer>::difference_type<br>
>>> > difference_type;<br>
>>> > -    typedef const value_type&                          reference;<br>
>>> > -    typedef typename __rebind_pointer<__node_pointer, const<br>
>>> > value_type>::type pointer;<br>
>>> > -    typedef typename __rebind_pointer<__node_pointer, __node>::type<br>
>>> > __non_const_node_pointer;<br>
>>> > -    typedef __hash_iterator<__non_const_node_pointer><br>
>>> > __non_const_iterator;<br>
>>> > +    typedef forward_iterator_tag<br>
>>> > iterator_category;<br>
>>> > +    typedef typename _NodeTypes::__node_value_type<br>
>>> > value_type;<br>
>>> > +    typedef typename _NodeTypes::difference_type<br>
>>> > difference_type;<br>
>>> > +    typedef const value_type&<br>
>>> > reference;<br>
>>> > +    typedef typename _NodeTypes::__const_node_value_type_pointer<br>
>>> > 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<br>
>>> > _LIBCPP_TYPE_VIS_ONLY unordered_multimap;<br>
>>> >  };<br>
>>> ><br>
>>> > -template <class _ConstNodePtr> class _LIBCPP_TYPE_VIS_ONLY<br>
>>> > __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<br>
>>> > iterator_category;<br>
>>> > -    typedef typename __pointer_traits::element_type::value_type<br>
>>> > value_type;<br>
>>> > -    typedef typename __pointer_traits::difference_type<br>
>>> > difference_type;<br>
>>> > +    typedef typename _NodeTypes::__node_value_type<br>
>>> > value_type;<br>
>>> > +    typedef typename _NodeTypes::difference_type<br>
>>> > difference_type;<br>
>>> >      typedef value_type&<br>
>>> > reference;<br>
>>> > -    typedef typename __rebind_pointer<__node_pointer,<br>
>>> > value_type>::type pointer;<br>
>>> > +    typedef typename _NodeTypes::__node_value_type_pointer<br>
>>> > 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>
>>> ><br>
>>> > __non_const_iterator;<br>
>>> >  public:<br>
>>> > -    typedef forward_iterator_tag<br>
>>> > iterator_category;<br>
>>> > -    typedef typename remove_const<<br>
>>> > -                        typename<br>
>>> > __pointer_traits::element_type::value_type<br>
>>> > -                     >::type                           value_type;<br>
>>> > -    typedef typename __pointer_traits::difference_type<br>
>>> > difference_type;<br>
>>> > -    typedef const value_type&                          reference;<br>
>>> > -    typedef typename __rebind_pointer<__node_pointer, const<br>
>>> > value_type>::type<br>
>>> > -        pointer;<br>
>>> > +    typedef forward_iterator_tag<br>
>>> > iterator_category;<br>
>>> > +    typedef typename _NodeTypes::__node_value_type<br>
>>> > value_type;<br>
>>> > +    typedef typename _NodeTypes::difference_type<br>
>>> > difference_type;<br>
>>> > +    typedef const value_type&<br>
>>> > reference;<br>
>>> > +    typedef typename _NodeTypes::__const_node_value_type_pointer<br>
>>> > 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<br>
>>> > allocator_type;<br>
>>> >      typedef allocator_traits<allocator_type><br>
>>> > __alloc_traits;<br>
>>> > -    typedef typename __alloc_traits::value_type::value_type<br>
>>> > 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<br>
>>> > __alloc_traits::void_pointer>::type<br>
>>> > +<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<br>
>>> > __alloc_traits::void_pointer> __node;<br>
>>> > +<br>
>>> > +    typedef typename _NodeTypes::__node_type __node;<br>
>>> >      typedef typename __rebind_alloc_helper<__alloc_traits,<br>
>>> > __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<br>
>>> > __node_const_pointer;<br>
>>> > -    typedef __hash_node_base<__node_pointer>         __first_node;<br>
>>> > -    typedef typename __rebind_pointer<__node_pointer,<br>
>>> > __first_node>::type<br>
>>> > -        __node_base_pointer;<br>
>>> > +    typedef typename _NodeTypes::__node_pointer      __node_pointer;<br>
>>> > +    typedef typename _NodeTypes::__node_pointer<br>
>>> > __node_const_pointer;<br>
>>> > +    typedef typename _NodeTypes::__node_base_type    __first_node;<br>
>>> > +    typedef typename _NodeTypes::__node_base_pointer<br>
>>> > __node_base_pointer;<br>
>>> > +<br>
>>> > +private:<br>
>>> > +    // check for sane allocator pointer rebinding semantics. Rebinding<br>
>>> > the<br>
>>> > +    // allocator for a new pointer type should be exactly the same as<br>
>>> > rebinding<br>
>>> > +    // the pointer using 'pointer_traits'.<br>
>>> > +    static_assert((is_same<__node_pointer, typename<br>
>>> > __node_traits::pointer>::value),<br>
>>> > +                  "Allocator does not rebind pointers in a sane<br>
>>> > manner.");<br>
>>> > +    typedef typename __rebind_alloc_helper<__node_traits,<br>
>>> > __first_node>::type<br>
>>> > +        __node_base_allocator;<br>
>>> > +    typedef allocator_traits<__node_base_allocator><br>
>>> > __node_base_traits;<br>
>>> > +    static_assert((is_same<__node_base_pointer, typename<br>
>>> > __node_base_traits::pointer>::value),<br>
>>> > +                 "Allocator does not rebind pointers in a sane<br>
>>> > manner.");<br>
>>> ><br>
>>> >  private:<br>
>>> ><br>
>>> > @@ -755,10 +871,10 @@ private:<br>
>>> >      typedef typename __bucket_list_deleter::pointer<br>
>>> > __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<br>
>>> > __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:<br>
>>> > <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>
>>> > ==============================================================================<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<br>
>>> > value_type;<br>
>>> > +    typedef typename __alloc_traits::value_type::__node_value_type<br>
>>> > value_type;<br>
>>> >  public:<br>
>>> >      typedef typename __alloc_traits::pointer    pointer;<br>
>>> >  private:<br>
>>> ><br>
>>> > Modified: libcxx/trunk/include/unordered_map<br>
>>> > URL:<br>
>>> > <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>
>>> > ==============================================================================<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<br>
>>> > 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<br>
>>> > first_type;<br>
>>> > -    typedef typename value_type::value_type::second_type<br>
>>> > 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<br>
>>> > _HashIterator::value_type::value_type::first_type key_type;<br>
>>> > -    typedef typename<br>
>>> > _HashIterator::value_type::value_type::second_type      mapped_type;<br>
>>> > +    typedef  __hash_node_types_from_iterator<_HashIterator><br>
>>> > _NodeTypes;<br>
>>> > +<br>
>>> >  public:<br>
>>> >      typedef forward_iterator_tag<br>
>>> > iterator_category;<br>
>>> > -    typedef pair<key_type, mapped_type><br>
>>> > value_type;<br>
>>> > -    typedef typename _HashIterator::difference_type<br>
>>> > difference_type;<br>
>>> > +    typedef typename _NodeTypes::__map_value_type<br>
>>> > value_type;<br>
>>> > +    typedef typename _NodeTypes::difference_type<br>
>>> > difference_type;<br>
>>> >      typedef value_type&<br>
>>> > reference;<br>
>>> > -    typedef typename __rebind_pointer<typename _HashIterator::pointer,<br>
>>> > value_type>::type<br>
>>> > -        pointer;<br>
>>> > +    typedef typename _NodeTypes::__map_value_type_pointer<br>
>>> > 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<br>
>>> > _HashIterator::value_type::value_type::first_type key_type;<br>
>>> > -    typedef typename<br>
>>> > _HashIterator::value_type::value_type::second_type      mapped_type;<br>
>>> > +    typedef  __hash_node_types_from_iterator<_HashIterator><br>
>>> > _NodeTypes;<br>
>>> > +<br>
>>> >  public:<br>
>>> >      typedef forward_iterator_tag<br>
>>> > iterator_category;<br>
>>> > -    typedef pair<key_type, mapped_type><br>
>>> > value_type;<br>
>>> > -    typedef typename _HashIterator::difference_type<br>
>>> > difference_type;<br>
>>> > +    typedef typename _NodeTypes::__map_value_type<br>
>>> > value_type;<br>
>>> > +    typedef typename _NodeTypes::difference_type<br>
>>> > difference_type;<br>
>>> >      typedef const value_type&<br>
>>> > reference;<br>
>>> > -    typedef typename __rebind_pointer<typename _HashIterator::pointer,<br>
>>> > const value_type>::type<br>
>>> > -        pointer;<br>
>>> > +    typedef typename _NodeTypes::__const_map_value_type_pointer<br>
>>> > 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><br>
>>> > iterator;<br>
>>> >      typedef __hash_map_const_iterator<typename<br>
>>> > __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><br>
>>> > __node_holder;<br>
>>> >      typedef allocator_traits<allocator_type><br>
>>> > __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<br>
>>> > 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><br>
>>> > iterator;<br>
>>> >      typedef __hash_map_const_iterator<typename<br>
>>> > __table::const_iterator> const_iterator;<br>
>>> ><br>
>>> > Added:<br>
>>> > libcxx/trunk/test/libcxx/containers/unord/key_value_traits.pass.cpp<br>
>>> > URL:<br>
>>> > <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>
>>> > ==============================================================================<br>
>>> > --- libcxx/trunk/test/libcxx/containers/unord/key_value_traits.pass.cpp<br>
>>> > (added)<br>
>>> > +++ libcxx/trunk/test/libcxx/containers/unord/key_value_traits.pass.cpp<br>
>>> > Wed Feb 10 14:46:23 2016<br>
>>> > @@ -0,0 +1,59 @@<br>
>>> ><br>
>>> > +//===----------------------------------------------------------------------===//<br>
>>> > +//<br>
>>> > +//                     The LLVM Compiler Infrastructure<br>
>>> > +//<br>
>>> > +// This file is dual licensed under the MIT and the University of<br>
>>> > Illinois Open<br>
>>> > +// Source Licenses. See LICENSE.TXT for details.<br>
>>> > +//<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,<br>
>>> > Tp>::value), "");<br>
>>> > +    static_assert((std::is_same<Traits::__container_value_type,<br>
>>> > 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,<br>
>>> > Tp>::value), "");<br>
>>> > +    static_assert((std::is_same<Traits::__container_value_type,<br>
>>> > 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,<br>
>>> > Tp>::value), "");<br>
>>> > +    static_assert((std::is_same<Traits::__container_value_type,<br>
>>> > 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>
>>> > "");<br>
>>> > +    static_assert((std::is_same<Traits::__node_value_type,<br>
>>> > Tp>::value), "");<br>
>>> > +    static_assert((std::is_same<Traits::__container_value_type,<br>
>>> > +                               std::pair<const int, int> >::value),<br>
>>> > "");<br>
>>> > +    static_assert((std::is_same<Traits::__map_value_type,<br>
>>> > +                               std::pair<const int, int> >::value),<br>
>>> > "");<br>
>>> > +    static_assert(Traits::__is_map == true, "");<br>
>>> > +  }<br>
>>> > +}<br>
>>> > +<br>
>>> > +int main() {<br>
>>> > +  testKeyValueTrait();<br>
>>> > +}<br>
>>> ><br>
>>> > Added:<br>
>>> > libcxx/trunk/test/std/containers/unord/iterator_difference_type.pass.cpp<br>
>>> > URL:<br>
>>> > <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>
>>> > ==============================================================================<br>
>>> > ---<br>
>>> > libcxx/trunk/test/std/containers/unord/iterator_difference_type.pass.cpp<br>
>>> > (added)<br>
>>> > +++<br>
>>> > libcxx/trunk/test/std/containers/unord/iterator_difference_type.pass.cpp Wed<br>
>>> > Feb 10 14:46:23 2016<br>
>>> > @@ -0,0 +1,154 @@<br>
>>> ><br>
>>> > +//===----------------------------------------------------------------------===//<br>
>>> > +//<br>
>>> > +//                     The LLVM Compiler Infrastructure<br>
>>> > +//<br>
>>> > +// This file is dual licensed under the MIT and the University of<br>
>>> > Illinois Open<br>
>>> > +// Source Licenses. See LICENSE.TXT for details.<br>
>>> > +//<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,<br>
>>> > ValueTp>::value), "");<br>
>>> > +    static_assert((std::is_same<typename It::reference,<br>
>>> > ValueTp&>::value), "");<br>
>>> > +    static_assert((std::is_same<typename It::pointer, PtrT>::value),<br>
>>> > "");<br>
>>> > +    static_assert((std::is_same<typename It::difference_type,<br>
>>> > Diff>::value), "");<br>
>>> > +  }<br>
>>> > +  {<br>
>>> > +    typedef typename Map::const_iterator It;<br>
>>> > +    static_assert((std::is_same<typename It::value_type,<br>
>>> > ValueTp>::value), "");<br>
>>> > +    static_assert((std::is_same<typename It::reference, ValueTp<br>
>>> > const&>::value), "");<br>
>>> > +    static_assert((std::is_same<typename It::pointer, CPtrT>::value),<br>
>>> > "");<br>
>>> > +    static_assert((std::is_same<typename It::difference_type,<br>
>>> > Diff>::value), "");<br>
>>> > +  }<br>
>>> > +  {<br>
>>> > +    typedef typename Map::local_iterator It;<br>
>>> > +    static_assert((std::is_same<typename It::value_type,<br>
>>> > ValueTp>::value), "");<br>
>>> > +    static_assert((std::is_same<typename It::reference,<br>
>>> > ValueTp&>::value), "");<br>
>>> > +    static_assert((std::is_same<typename It::pointer, PtrT>::value),<br>
>>> > "");<br>
>>> > +    static_assert((std::is_same<typename It::difference_type,<br>
>>> > Diff>::value), "");<br>
>>> > +  }<br>
>>> > +  {<br>
>>> > +    typedef typename Map::const_local_iterator It;<br>
>>> > +    static_assert((std::is_same<typename It::value_type,<br>
>>> > ValueTp>::value), "");<br>
>>> > +    static_assert((std::is_same<typename It::reference, ValueTp<br>
>>> > const&>::value), "");<br>
>>> > +    static_assert((std::is_same<typename It::pointer, CPtrT>::value),<br>
>>> > "");<br>
>>> > +    static_assert((std::is_same<typename It::difference_type,<br>
>>> > 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>
>>> > "");<br>
>>> > +  static_assert((std::is_same<typename Set::local_iterator,<br>
>>> > +                             typename<br>
>>> > 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,<br>
>>> > ValueTp>::value), "");<br>
>>> > +    static_assert((std::is_same<typename It::reference, ValueTp<br>
>>> > const&>::value), "");<br>
>>> > +    static_assert((std::is_same<typename It::pointer, CPtrT>::value),<br>
>>> > "");<br>
>>> > +    static_assert((std::is_same<typename It::difference_type,<br>
>>> > Diff>::value), "");<br>
>>> > +<br>
>>> > +  }<br>
>>> > +  {<br>
>>> > +    typedef typename Set::local_iterator It;<br>
>>> > +    static_assert((std::is_same<typename It::value_type,<br>
>>> > ValueTp>::value), "");<br>
>>> > +    static_assert((std::is_same<typename It::reference, ValueTp<br>
>>> > const&>::value), "");<br>
>>> > +    static_assert((std::is_same<typename It::pointer, CPtrT>::value),<br>
>>> > "");<br>
>>> > +    static_assert((std::is_same<typename It::difference_type,<br>
>>> > 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>,<br>
>>> > 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>,<br>
>>> > std::equal_to<int>, Alloc> Map;<br>
>>> > +    testUnorderedMap<Map, ValueTp, min_pointer<ValueTp>,<br>
>>> > 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>,<br>
>>> > 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>,<br>
>>> > std::equal_to<int>, Alloc> Map;<br>
>>> > +    testUnorderedMap<Map, ValueTp, min_pointer<ValueTp>,<br>
>>> > 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>,<br>
>>> > 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>,<br>
>>> > 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>,<br>
>>> > 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>,<br>
>>> > std::equal_to<ValueTp>, Alloc> Set;<br>
>>> > +    testUnorderedSet<Set, ValueTp, min_pointer<const ValueTp>>();<br>
>>> > +  }<br>
>>> > +#endif<br>
>>> > +}<br>
>>> ><br>
>>> > Added:<br>
>>> > libcxx/trunk/test/std/containers/unord/unord.map/incomplete_type.pass.cpp<br>
>>> > URL:<br>
>>> > <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>
>>> > ==============================================================================<br>
>>> > ---<br>
>>> > libcxx/trunk/test/std/containers/unord/unord.map/incomplete_type.pass.cpp<br>
>>> > (added)<br>
>>> > +++<br>
>>> > libcxx/trunk/test/std/containers/unord/unord.map/incomplete_type.pass.cpp<br>
>>> > Wed Feb 10 14:46:23 2016<br>
>>> > @@ -0,0 +1,37 @@<br>
>>> > +<br>
>>> ><br>
>>> > +//===----------------------------------------------------------------------===//<br>
>>> > +//<br>
>>> > +//                     The LLVM Compiler Infrastructure<br>
>>> > +//<br>
>>> > +// This file is dual licensed under the MIT and the University of<br>
>>> > Illinois Open<br>
>>> > +// Source Licenses. See LICENSE.TXT for details.<br>
>>> > +//<br>
>>> ><br>
>>> > +//===----------------------------------------------------------------------===//<br>
>>> > +<br>
>>> > +// <unordered_map><br>
>>> > +<br>
>>> > +// Check that std::unordered_map and it's iterators can be<br>
>>> > 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:<br>
>>> > libcxx/trunk/test/std/containers/unord/unord.multimap/incomplete.pass.cpp<br>
>>> > URL:<br>
>>> > <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>
>>> > ==============================================================================<br>
>>> > ---<br>
>>> > libcxx/trunk/test/std/containers/unord/unord.multimap/incomplete.pass.cpp<br>
>>> > (added)<br>
>>> > +++<br>
>>> > libcxx/trunk/test/std/containers/unord/unord.multimap/incomplete.pass.cpp<br>
>>> > Wed Feb 10 14:46:23 2016<br>
>>> > @@ -0,0 +1,37 @@<br>
>>> > +<br>
>>> ><br>
>>> > +//===----------------------------------------------------------------------===//<br>
>>> > +//<br>
>>> > +//                     The LLVM Compiler Infrastructure<br>
>>> > +//<br>
>>> > +// This file is dual licensed under the MIT and the University of<br>
>>> > Illinois Open<br>
>>> > +// Source Licenses. See LICENSE.TXT for details.<br>
>>> > +//<br>
>>> ><br>
>>> > +//===----------------------------------------------------------------------===//<br>
>>> > +<br>
>>> > +// <unordered_map><br>
>>> > +<br>
>>> > +// Check that std::unordered_multimap and it's iterators can be<br>
>>> > 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:<br>
>>> > libcxx/trunk/test/std/containers/unord/unord.multiset/incomplete.pass.cpp<br>
>>> > URL:<br>
>>> > <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>
>>> > ==============================================================================<br>
>>> > ---<br>
>>> > libcxx/trunk/test/std/containers/unord/unord.multiset/incomplete.pass.cpp<br>
>>> > (added)<br>
>>> > +++<br>
>>> > libcxx/trunk/test/std/containers/unord/unord.multiset/incomplete.pass.cpp<br>
>>> > Wed Feb 10 14:46:23 2016<br>
>>> > @@ -0,0 +1,38 @@<br>
>>> > +<br>
>>> > +<br>
>>> ><br>
>>> > +//===----------------------------------------------------------------------===//<br>
>>> > +//<br>
>>> > +//                     The LLVM Compiler Infrastructure<br>
>>> > +//<br>
>>> > +// This file is dual licensed under the MIT and the University of<br>
>>> > Illinois Open<br>
>>> > +// Source Licenses. See LICENSE.TXT for details.<br>
>>> > +//<br>
>>> ><br>
>>> > +//===----------------------------------------------------------------------===//<br>
>>> > +<br>
>>> > +// <unordered_set><br>
>>> > +<br>
>>> > +// Check that std::unordered_multiset and it's iterators can be<br>
>>> > 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:<br>
>>> > libcxx/trunk/test/std/containers/unord/unord.set/incomplete.pass.cpp<br>
>>> > URL:<br>
>>> > <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>
>>> > ==============================================================================<br>
>>> > ---<br>
>>> > libcxx/trunk/test/std/containers/unord/unord.set/incomplete.pass.cpp (added)<br>
>>> > +++<br>
>>> > libcxx/trunk/test/std/containers/unord/unord.set/incomplete.pass.cpp Wed Feb<br>
>>> > 10 14:46:23 2016<br>
>>> > @@ -0,0 +1,38 @@<br>
>>> > +<br>
>>> > +<br>
>>> ><br>
>>> > +//===----------------------------------------------------------------------===//<br>
>>> > +//<br>
>>> > +//                     The LLVM Compiler Infrastructure<br>
>>> > +//<br>
>>> > +// This file is dual licensed under the MIT and the University of<br>
>>> > Illinois Open<br>
>>> > +// Source Licenses. See LICENSE.TXT for details.<br>
>>> > +//<br>
>>> ><br>
>>> > +//===----------------------------------------------------------------------===//<br>
>>> > +<br>
>>> > +// <unordered_set><br>
>>> > +<br>
>>> > +// Check that std::unordered_set and it's iterators can be<br>
>>> > 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>
>><br>
>><br>
><br>
</div></div></blockquote></div><br></div>