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

    <tr>
        <th>Summary</th>
        <td>
            `misc-const-correctness` false positive with non-trivial object which is being moved
        </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
#include <list>
#include <string>

class A {
    std::string s;

public:
    A();
    ~A(); // remove to fix warning
};

static void f()
{
    std::list<A> l;

    A a;
    l.emplace_back(std::move(a));
}
```

```
<source>:16:5: warning: variable 'a' of type 'A' can be declared 'const' [misc-const-correctness]
    A a;
    ^
      const
```

https://godbolt.org/z/sf5ox1arK
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx1U82SojAQfppw6dIKiYAeOOjoXvYhtkJoNLuRUEnQmX367cCMutZIhdA_6a-_7g6Naz9qVvJ56WFgfM_4lglpem3HFoHJN2tCZPLwnStEb_rj3Tnt2qoQYAus2s0GoCfElsktrTkEApO7x6BhbKzR6cgthHKtmdjcDiYbqw53MzDxgxZ4PLsLQnTQmXe4Kt8nUjN4tX9KFKKKRsPFmRa6T6jPo9_RnYt_I_EA9glqIgnqP4J2iefBKo2_GqX_EP4NKXEkXaWED1UlhrPwNYbHFM9GarkbvcbUcrnNS9oKem9Fk3hR3qjG0nxERckqcB3Ej2HSt0nXqocGoUUalMc22bXrqUzysWJ3NkEvJgPt3qOOPYbAiv3rollxuCsAM9rrok4xDiE1ZRrf0bWNs3Hp_JG0v_SGrnDvufI_M6zzsuSb9Wa1kllby3YjNyqLJlpM1_YF1ZJDp2xAGFww0dDVuJp4gt71C7p8F6MsuOY3nYbryegTmED9SJcyjajNRm_rJ4oUPjZL7c6kWHv5-iwG7xIOqSaEEQMJRSXKMjvV67zSRZdrIbhEUXZylfOykBVyXuTVWmdWNWhDTR1nQvR4hQmCZGp1ZmrBKXItON8Qolx2opJtqVpRcl5hpdmK41kZu0w8Uu8yX0-UmvEYyJnubbg76Y80xx5xSkf4aown5-vOeLyqC2ZT7nri_g8fFifD">