aboutsummaryrefslogtreecommitdiff
path: root/src/core/lib/gprpp/ref_counted.h
diff options
context:
space:
mode:
authorVijay Pai <vpai@google.com>2018-02-06 18:41:05 -0800
committerVijay Pai <vpai@google.com>2018-02-06 18:41:05 -0800
commit2f45758699e15bb34df8d285704878fbbd3bb62c (patch)
tree970908ed1fca4d731445e4b05bdd7a78d572b068 /src/core/lib/gprpp/ref_counted.h
parent3629f1f3bc22532f4734a7388ecd4129c529534f (diff)
downloadgrpc-grpc-2f45758699e15bb34df8d285704878fbbd3bb62c.tar.gz
Enforce CRTP: weaken reinterpret_cast to static_cast
Diffstat (limited to 'src/core/lib/gprpp/ref_counted.h')
-rw-r--r--src/core/lib/gprpp/ref_counted.h4
1 files changed, 2 insertions, 2 deletions
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<Child> Ref() GRPC_MUST_USE_RESULT {
IncrementRefCount();
- return RefCountedPtr<Child>(reinterpret_cast<Child*>(this));
+ return RefCountedPtr<Child>(static_cast<Child*>(this));
}
// TODO(roth): Once all of our code is converted to C++ and can use
@@ -89,7 +89,7 @@ class RefCountedWithTracing {
public:
RefCountedPtr<Child> Ref() GRPC_MUST_USE_RESULT {
IncrementRefCount();
- return RefCountedPtr<Child>(reinterpret_cast<Child*>(this));
+ return RefCountedPtr<Child>(static_cast<Child*>(this));
}
RefCountedPtr<Child> Ref(const DebugLocation& location,