From 7e26a7e84e94a50a0b04e70ed88ac04d75afbf40 Mon Sep 17 00:00:00 2001 From: WenTao Ou Date: Wed, 30 Nov 2022 04:15:57 +0800 Subject: [PATCH] Fix type mismatch when move `nostd::shared_ptr` (#1815) L --- api/include/opentelemetry/nostd/shared_ptr.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/include/opentelemetry/nostd/shared_ptr.h b/api/include/opentelemetry/nostd/shared_ptr.h index e1eac61561..7afc30f9be 100644 --- a/api/include/opentelemetry/nostd/shared_ptr.h +++ b/api/include/opentelemetry/nostd/shared_ptr.h @@ -56,7 +56,8 @@ class shared_ptr typename std::enable_if::value>::type * = nullptr> void MoveTo(typename shared_ptr::PlacementBuffer &buffer) noexcept { - new (buffer.data) shared_ptr_wrapper{std::move(this->ptr_)}; + using other_shared_ptr_wrapper = typename shared_ptr::shared_ptr_wrapper; + new (buffer.data) other_shared_ptr_wrapper{std::move(this->ptr_)}; } virtual pointer Get() const noexcept { return ptr_.get(); }