Skip to content

Commit 7e1355e

Browse files
committed
[libc++] Mark __wrap_iter's private constructors as explicit.
This is slightly more user-visible than D119894, because the user is expected to touch `__wrap_iter` directly. But the affected ctors are non-public, so the user was never expected to be actually calling them. And I didn't intentionally omit this from D119894; I just didn't think of it. Differential Revision: https://reviews.llvm.org/D120937
1 parent bccc88b commit 7e1355e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

libcxx/include/__iterator/wrap_iter.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,15 @@ class __wrap_iter
136136

137137
private:
138138
#if _LIBCPP_DEBUG_LEVEL == 2
139-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __wrap_iter(const void* __p, iterator_type __x) : __i(__x)
139+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
140+
explicit __wrap_iter(const void* __p, iterator_type __x) : __i(__x)
140141
{
141142
if (!__libcpp_is_constant_evaluated())
142143
__get_db()->__insert_ic(this, __p);
143144
}
144145
#else
145-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __wrap_iter(iterator_type __x) _NOEXCEPT : __i(__x) {}
146+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
147+
explicit __wrap_iter(iterator_type __x) _NOEXCEPT : __i(__x) {}
146148
#endif
147149

148150
template <class _Up> friend class __wrap_iter;

0 commit comments

Comments
 (0)