Doug Gregor pointed out some problems with debug mode enabled in one TU and not another.  This patch helps detect those situations and offers improved error messages to help get debug mode enabled in more TU's when it is absolutely necessary to do so.  Thanks Doug.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@139933 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/iterator b/include/iterator
index d5f1eb7..05019fd 100644
--- a/include/iterator
+++ b/include/iterator
@@ -1063,7 +1063,12 @@
 private:
     iterator_type __i;
 public:
-    _LIBCPP_INLINE_VISIBILITY __wrap_iter() _NOEXCEPT {}
+    _LIBCPP_INLINE_VISIBILITY __wrap_iter() _NOEXCEPT
+    {
+#if _LIBCPP_DEBUG_LEVEL >= 2
+        __get_db()->__insert_i(this);
+#endif
+    }
     template <class _Up> _LIBCPP_INLINE_VISIBILITY __wrap_iter(const __wrap_iter<_Up>& __u,
         typename enable_if<is_convertible<_Up, iterator_type>::value>::type* = 0) _NOEXCEPT
         : __i(__u.base())