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
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 2f51de568f80d1b7992ddb4a43b7328c7fb965d6
diff --git a/include/__debug b/include/__debug
index 4c920a7..bac580c 100644
--- a/include/__debug
+++ b/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/include/__hash_table b/include/__hash_table
index a8d9222..7b0fc41 100644
--- a/include/__hash_table
+++ b/include/__hash_table
@@ -1714,6 +1714,11 @@
__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_;