From 3b642d24057869f77992cf3fc7d6d89c372789c4 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 17 Jan 2024 18:27:09 +0000 Subject: [PATCH] refine --- src/core/lib/gprpp/ref_counted.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/lib/gprpp/ref_counted.h b/src/core/lib/gprpp/ref_counted.h index ecaf62c0399a2..0b21ecf01692b 100644 --- a/src/core/lib/gprpp/ref_counted.h +++ b/src/core/lib/gprpp/ref_counted.h @@ -311,7 +311,8 @@ class RefCounted : public Impl { std::enable_if_t::value, bool> = true> RefCountedPtr RefAsSubclass() { IncrementRefCount(); - return RefCountedPtr(down_cast(this)); + return RefCountedPtr( + down_cast(static_cast(this))); } template < typename Subclass, @@ -319,7 +320,8 @@ class RefCounted : public Impl { RefCountedPtr RefAsSubclass(const DebugLocation& location, const char* reason) { IncrementRefCount(location, reason); - return RefCountedPtr(down_cast(this)); + return RefCountedPtr( + down_cast(static_cast(this))); } // RefIfNonZero() for mutable types.