diff --git a/libcxx/include/ext/hash_map b/libcxx/include/ext/hash_map index 225b72baa2c9..36cd595e0343 100644 --- a/libcxx/include/ext/hash_map +++ b/libcxx/include/ext/hash_map @@ -430,9 +430,9 @@ public: typedef const value_type& reference; typedef typename __pointer_traits::template #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind + rebind #else - rebind::other + rebind::other #endif pointer; diff --git a/libcxx/test/extensions/hash_map/const_iterator.fail.cpp b/libcxx/test/extensions/hash_map/const_iterator.fail.cpp new file mode 100644 index 000000000000..e4c536e8f33a --- /dev/null +++ b/libcxx/test/extensions/hash_map/const_iterator.fail.cpp @@ -0,0 +1,18 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +#include + +int main() +{ + __gnu_cxx::hash_map m; + m[1] = 1; + const __gnu_cxx::hash_map &cm = m; + cm.find(1)->second = 2; // error +}