<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/64955>64955</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            `misc-const-correctness.WarnPointersAsValues` not detected with non-const member call
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          firewave
      </td>
    </tr>
</table>

<pre>
    ```cpp
class T
{
public:
    void f(); // make function const for warning to appear
};

void f()
{
    T* /*const*/ t = new T();
 t->f();
}
```
https://godbolt.org/z/TW3r5Y1d8

The pointer can be `const`. As this is just about the variable and not the type it should not matter what kind of member is called on it.
The warning does triggers if you access a non-function member.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxcUk1vozAQ_TXmMgpyTcjHgUOqbM57iLbao7EHcGts5BkSdX_9ypBut5Wi4Bnwe2_ePE3k-oDYiPpZ1OdCzzzE1HQu4V3fsGijfW_ETq4_M01CnoU8Ga-J4LoWYv-8Hqa59c6I6rSWAAC36Cx0Qh2EOorqGYS6CHWBUb8hdHMw7GIAEwMxdDHBXafgQg8cQU8T6vTBcBbVg2T9_4L7VUWmvQp1WrlOC7hQp0zLIKozBLznDx6SHpd4I6of3bdu5l0PHw6s5cA8UZ5zmaaPto2ey5h6oS5_hLpcX6pU_36yh_8lXweEKbrAmMDoAC1CtnSRt5MlnAh4cASO4HUmBt3GmYEHhJtOTrceQQcLIa5Nfp8QHAMNcfZre9Scwe-DZnhzwULsYMSxxZRBjfYeLcQAjstPSR-W24gEnFzfYyJwHbzHGbQxSAQaQgybf_taMcvCNpU9VkddYPO0O6rDfruXshgaRKOk1HjEquuMqiqFcrc31cHW2NXqULhGSVXJg9o-yfqgZNl12uzxuFOtqW27rcRW4qidL72_jdnYwhHN2Oy2x7ouvG7R0xJZpfI2l5dCqZzg1OQ7m3buSWyld8T0icKOPeY8j47MZvF-Y2JKaDggUfmiU_i57ohO9Ev7GUns5OKuRUbDaOHueFgMWXP7cDjbW8zJN9_C4XiY29LEUahL1vF4bKYUX9GwUJdFPQl1Wab7GwAA__9bDBrQ">