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

    <tr>
        <th>Summary</th>
        <td>
            [clang-tidy] "bugprone-return-const-ref-from-parameter" - should catch references to a field of parameter in return
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-tidy
      </td>
    </tr>

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

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

<pre>
    This check is expected to show warning in this function:
```
struct S {
  int v;
  S(int);
  ~S();
};

const int &fn2(const S &a) {
  return a.v;
}
```
But it didn't. The full snippet here: https://godbolt.org/z/h6dv7fqEn
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxcUt1y2ywQfZrVzY48eNGPfaELZ_L5BZIXQLBIfMWgAnKaXPTZO7LdpO0MM7BnOPtz9qic3RSYB2ifoH2u1FrmmAbD4SMmEqIao3kfXmeXUc-sv6HLyD8W1oUNloh5jm_4plJwYUIXsGw_7Rp0cTGAPIE4QSceR5xySasu-ILQP4E4IbpQ8AryHrwAHVwoQMffyM8N-oyhf348xEnHkMuNDtTZQECHO_SyAQro-FkjcVlTQLW7fqX5u62ntaAraJwJQH3Z4evMaFfvMQe3LFxw5sQgTziXsuRtLjoDnadoxujLLqYJ6PwBdJ47c-3t9_9CZQZpjvKoKh72fdO3fbcXspqHsZUH7o9NP9pmlMdOjqPtLOu-PTSm16ZyAwlqRbs_7GVzILmzqmtk35Ewct9oaaARfFHO77y_Xrbalct55WHfiKaVlVcj-3xbKJH2Kkx1ceYdiLYFp2Fj1eM6ZWiEd7nkrzzFFX-zwh-09hmBaFynJcXA9V3M-qZ1ndjWNsVLvaikLlw4ARHWmytWb1CromdMbDlx0Jw3wyi0jr3BaPGTtBnnnrdakx_-0diVeR13Ol6Azlunj6teUvyfdQE638bPQOeHAteBfgUAAP__ywPhuA">