The value is unused if I use operator overload
已回答
I have the following code, where Handle.operator-> is overloaded, readCount_ is a field in mirror::Object.
If I use this_object->readCount_, CLion reports warning "The value is unused".

ALWAYS_INLINE T* operator->() const REQUIRES_SHARED(Locks::mutator_lock_) {
return Get();
}
If I use the code inside Handle.operator->, i.e. the Get method, directly, CLion no longer complains.

Why does using operator-> and Get make a difference?
请先登录再写评论。
Hello!
It might be related to https://youtrack.jetbrains.com/issue/CPP-7998. Please provide a standalone code snippet in the comments.