From 2f45758699e15bb34df8d285704878fbbd3bb62c Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Tue, 6 Feb 2018 18:41:05 -0800 Subject: Enforce CRTP: weaken reinterpret_cast to static_cast --- src/core/lib/gprpp/ref_counted.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/lib/gprpp/ref_counted.h b/src/core/lib/gprpp/ref_counted.h index 16c7912fc6..ab589fc01a 100644 --- a/src/core/lib/gprpp/ref_counted.h +++ b/src/core/lib/gprpp/ref_counted.h @@ -41,7 +41,7 @@ class RefCounted { public: RefCountedPtr Ref() GRPC_MUST_USE_RESULT { IncrementRefCount(); - return RefCountedPtr(reinterpret_cast(this)); + return RefCountedPtr(static_cast(this)); } // TODO(roth): Once all of our code is converted to C++ and can use @@ -89,7 +89,7 @@ class RefCountedWithTracing { public: RefCountedPtr Ref() GRPC_MUST_USE_RESULT { IncrementRefCount(); - return RefCountedPtr(reinterpret_cast(this)); + return RefCountedPtr(static_cast(this)); } RefCountedPtr Ref(const DebugLocation& location, -- cgit v1.2.3