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

    <tr>
        <th>Summary</th>
        <td>
            Create performance-proxy-object-copy check
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-tidy,
            check-request
      </td>
    </tr>

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

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

<pre>
    I'm adding this here so, i wouldn't forget.

Example:
```
struct A
{
    const std::string& getS() { return s; }
    std::string s;
};

struct AProxy
{
    AProxy(A& a) : a(a) {}
 std::string getS() { return s.getS(); }
    A& a;
};

```

Should detect copies of nontrivial heavy objects returned from a call as const reference, but returned as value.
This can be common mistake when writing proxies, and then changing only 1 interface instead of two.
This can be expected behaviour when writing proxies that add something (like mutex locks), in such case behavior can be expected, so best would be to detect only functions that have only returnStmt.

Check name is up to negotation.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0VE2P4jgQ_TXOpQQKDvk65NDdLNJKexip97S3ilMk3nZs1i7T8O9XDmmhYXokFBy_8nuvPhwMQY-WqBPlqygPGUaenO9-aMf-n_e_st4Nt-5PIesZcBi0HYEnHWAiTxCckG-g4dNFM1gha4aT8yPxVuQHkb_cn39ccT4bEsX6Lqp8_S2vgX1UDF9g_XpfAAAoZwND4CGdLVKktqOQFYzE70I2QrYg6lfwxNFbCKJ4BVEfHgRPR5eIL53DY_2Tjx_eXW_fmFkB2bwkB7hoFy9p0eBq5KH9LPwbw9vH_i_eV5nfG36q4_35PqVewEBMikG5s6YA7gTWWfb6otHARHi5gev_JcVhtUIDnLybAUGhMYBhrb2nE3myilKj-8iPcAxwQRNpbfXfaSgUWugJlJtnZ2HWgfGD4HMiC59ecyrE2burppDo0A7ACVMT2jGBzpob7EBbJn9CRaBtYMIhJcCf7hspup5JMQ3Q04QX7aL_Vg54Qk7zC8HNxFOChGyM_iCYI9MVjFMfIbUhDbSFENUECgN9EftnxRQYHPQU-D7_CWT3VfkllVO0irWzq_6EF7oD9yq-8_zzTXmbSH2AxZlAB4jnxGdpdIyJZZsNXTG0RYsZdbs6r2VR7to2m7qqVjk2Uiq5b_dVtVNqj9jWRUNV35yKOtOdzOU-l3m1K8u2LLdY7fN-N_Rtrfp91aLY5zSjNltjLvPW-THTIUTqmrwp28xgTyYsXwgplUE7blgPNyGlkG9pK_neePovUuC0Wx4y3yWqTR_HIPa50YHDg5w1G-rePCETnMmfnJ_RKtqkft0299ncKHe-wcKdRW-6ifkc0q2SRyGPo-Yp9lvlZiGPiXj9SxTptJDHJYUg5HHJ4v8AAAD__7MpipI">