From 7e1355eb1327ffa94f680e925e266b9404392f32 Mon Sep 17 00:00:00 2001 From: Arthur O'Dwyer Date: Thu, 3 Mar 2022 15:42:26 -0500 Subject: [PATCH] [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 --- libcxx/include/__iterator/wrap_iter.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libcxx/include/__iterator/wrap_iter.h b/libcxx/include/__iterator/wrap_iter.h index d91a25e..69e5ee1 100644 --- a/libcxx/include/__iterator/wrap_iter.h +++ b/libcxx/include/__iterator/wrap_iter.h @@ -136,13 +136,15 @@ public: private: #if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __wrap_iter(const void* __p, iterator_type __x) : __i(__x) + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 + explicit __wrap_iter(const void* __p, iterator_type __x) : __i(__x) { if (!__libcpp_is_constant_evaluated()) __get_db()->__insert_ic(this, __p); } #else - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __wrap_iter(iterator_type __x) _NOEXCEPT : __i(__x) {} + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 + explicit __wrap_iter(iterator_type __x) _NOEXCEPT : __i(__x) {} #endif template friend class __wrap_iter; -- 2.7.4