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
This commit is contained in:
Howard Hinnant
2011-09-16 19:52:23 +00:00
parent 0442b12591
commit 7608b4aac2
3 changed files with 26 additions and 5 deletions

View File

@@ -1063,7 +1063,12 @@ public:
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())