summaryrefslogtreecommitdiffstats
path: root/libcxx/include
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2013-08-02 17:50:49 +0000
committerHoward Hinnant <hhinnant@apple.com>2013-08-02 17:50:49 +0000
commit2f51de568f80d1b7992ddb4a43b7328c7fb965d6 (patch)
tree5671e4200ab2e61b3d652c3722410513f1d1e1bc /libcxx/include
parent0178a25fc5155b2a01791eb11b48d1b8286f8a83 (diff)
downloadbcm5719-llvm-2f51de568f80d1b7992ddb4a43b7328c7fb965d6.tar.gz
bcm5719-llvm-2f51de568f80d1b7992ddb4a43b7328c7fb965d6.zip
debug mode for unordered_map. Also picked up a missing check and test in unordered_multimap. This wraps up debug mode for the unordered containers.
llvm-svn: 187659
Diffstat (limited to 'libcxx/include')
-rw-r--r--libcxx/include/__debug4
-rw-r--r--libcxx/include/__hash_table5
2 files changed, 9 insertions, 0 deletions
diff --git a/libcxx/include/__debug b/libcxx/include/__debug
index 4c920a7f4ae..bac580cfa80 100644
--- a/libcxx/include/__debug
+++ b/libcxx/include/__debug
@@ -24,6 +24,10 @@
#if _LIBCPP_DEBUG_LEVEL >= 2
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
_LIBCPP_BEGIN_NAMESPACE_STD
struct _LIBCPP_TYPE_VIS __c_node;
diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table
index a8d922252e3..7b0fc412bd3 100644
--- a/libcxx/include/__hash_table
+++ b/libcxx/include/__hash_table
@@ -1714,6 +1714,11 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(
const_iterator __p, __node_pointer __cp)
{
+#if _LIBCPP_DEBUG_LEVEL >= 2
+ _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
+ "unordered container::emplace_hint(const_iterator, args...) called with an iterator not"
+ " referring to this unordered container");
+#endif
if (__p != end() && key_eq()(*__p, __cp->__value_))
{
__node_pointer __np = __p.__node_;
OpenPOWER on IntegriCloud