Index: include/__tree =================================================================== --- include/__tree +++ include/__tree @@ -614,8 +614,6 @@ { typedef _NodePtr __node_pointer; typedef typename pointer_traits<__node_pointer>::element_type __node; - typedef typename __node::base __node_base; - typedef typename __node_base::pointer __node_base_pointer; __node_pointer __ptr_; @@ -644,17 +642,21 @@ {return pointer_traits::pointer_to(__ptr_->__value_);} _LIBCPP_INLINE_VISIBILITY - __tree_iterator& operator++() - {__ptr_ = static_cast<__node_pointer>(__tree_next(static_cast<__node_base_pointer>(__ptr_))); - return *this;} + __tree_iterator& operator++() { + __ptr_ = static_cast<__node_pointer>( + __tree_next(static_cast(__ptr_))); + return *this; + } _LIBCPP_INLINE_VISIBILITY __tree_iterator operator++(int) {__tree_iterator __t(*this); ++(*this); return __t;} _LIBCPP_INLINE_VISIBILITY - __tree_iterator& operator--() - {__ptr_ = static_cast<__node_pointer>(__tree_prev(static_cast<__node_base_pointer>(__ptr_))); - return *this;} + __tree_iterator& operator--() { + __ptr_ = static_cast<__node_pointer>( + __tree_prev(static_cast(__ptr_))); + return *this; + } _LIBCPP_INLINE_VISIBILITY __tree_iterator operator--(int) {__tree_iterator __t(*this); --(*this); return __t;} @@ -683,14 +685,6 @@ { typedef _ConstNodePtr __node_pointer; typedef typename pointer_traits<__node_pointer>::element_type __node; - typedef typename __node::base __node_base; - typedef typename pointer_traits<__node_pointer>::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind<__node_base> -#else - rebind<__node_base>::other -#endif - __node_base_pointer; __node_pointer __ptr_; @@ -735,17 +729,39 @@ {return pointer_traits::pointer_to(__ptr_->__value_);} _LIBCPP_INLINE_VISIBILITY - __tree_const_iterator& operator++() - {__ptr_ = static_cast<__node_pointer>(__tree_next(static_cast<__node_base_pointer>(__ptr_))); - return *this;} + __tree_const_iterator& operator++() { + typedef typename pointer_traits<__node_pointer>::template +#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES + rebind +#else + rebind::other +#endif + __node_base_pointer; + + __ptr_ = static_cast<__node_pointer>( + __tree_next(static_cast<__node_base_pointer>(__ptr_))); + return *this; + } + _LIBCPP_INLINE_VISIBILITY __tree_const_iterator operator++(int) {__tree_const_iterator __t(*this); ++(*this); return __t;} _LIBCPP_INLINE_VISIBILITY - __tree_const_iterator& operator--() - {__ptr_ = static_cast<__node_pointer>(__tree_prev(static_cast<__node_base_pointer>(__ptr_))); - return *this;} + __tree_const_iterator& operator--() { + typedef typename pointer_traits<__node_pointer>::template +#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES + rebind +#else + rebind::other +#endif + __node_base_pointer; + + __ptr_ = static_cast<__node_pointer>( + __tree_prev(static_cast<__node_base_pointer>(__ptr_))); + return *this; + } + _LIBCPP_INLINE_VISIBILITY __tree_const_iterator operator--(int) {__tree_const_iterator __t(*this); --(*this); return __t;} Index: include/map =================================================================== --- include/map +++ include/map @@ -644,14 +644,26 @@ #endif +template +struct __value_type_traits +{ +}; + +template +struct __value_type_traits<__value_type<_Key, _Tp>> { + typedef _Key key_type; + typedef _Tp mapped_type; +}; + template class _LIBCPP_TYPE_VIS_ONLY __map_iterator { _TreeIterator __i_; typedef typename _TreeIterator::__pointer_traits __pointer_traits; - typedef const typename _TreeIterator::value_type::value_type::first_type __key_type; - typedef typename _TreeIterator::value_type::value_type::second_type __mapped_type; + + typedef const typename __value_type_traits::key_type __key_type; + typedef typename __value_type_traits::mapped_type __mapped_type; public: typedef bidirectional_iterator_tag iterator_category; typedef pair<__key_type, __mapped_type> value_type; @@ -715,8 +727,8 @@ _TreeIterator __i_; typedef typename _TreeIterator::__pointer_traits __pointer_traits; - typedef const typename _TreeIterator::value_type::value_type::first_type __key_type; - typedef typename _TreeIterator::value_type::value_type::second_type __mapped_type; + typedef const typename __value_type_traits::key_type __key_type; + typedef typename __value_type_traits::mapped_type __mapped_type; public: typedef bidirectional_iterator_tag iterator_category; typedef pair<__key_type, __mapped_type> value_type; Index: test/std/containers/associative/map/map.cons/default_recursive.pass.cpp =================================================================== --- test/std/containers/associative/map/map.cons/default_recursive.pass.cpp +++ test/std/containers/associative/map/map.cons/default_recursive.pass.cpp @@ -20,6 +20,10 @@ struct X { std::map m; + std::map::iterator i; + std::map::const_iterator ci; + std::map::reverse_iterator ri; + std::map::const_reverse_iterator cri; }; #endif Index: test/std/containers/associative/multimap/multimap.cons/default_recursive.pass.cpp =================================================================== --- test/std/containers/associative/multimap/multimap.cons/default_recursive.pass.cpp +++ test/std/containers/associative/multimap/multimap.cons/default_recursive.pass.cpp @@ -0,0 +1,33 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// class multimap + +// multimap(); + +#include + +#if !__has_feature(cxx_noexcept) + +struct X +{ + std::multimap m; + std::multimap::iterator i; + std::multimap::const_iterator ci; + std::multimap::reverse_iterator ri; + std::multimap::const_reverse_iterator cri; +}; + +#endif + +int main() +{ +}