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

    <tr>
        <th>Summary</th>
        <td>
            Clang cannot detect some unused definitions
        </td>
    </tr>

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

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

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

<pre>
    Hi,I'm using Clang for detecting unused definitions in programs. However, I find that Clang fails to detect some of them like:
int main()
{
  int ret = 0;
  ret = foo(6);
  return ret;
}
Clang currently does not report the unused `ret=0` and `ret=foo(6)` definitions even with flag '-Wunused'. So I wonder is there any reason for not detecting such unused definitions?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxtUstu4zAM_Br5QtQQJMdODj60DYL23MOeZYu21ZWlQI8G-ful7abJYhcwLGpIDoekOq-v7Zth4vWdiWaGHI0b4dUq-g8-gMaEfVqw7HJETcBgnEnGuwjGwTn4Mag5lvDmL_iFgZjgHShGQ5pUulEpYyMk_80H0c8IfqAQnMGa38jkM-NHxp-NSzAr45jYM3HYMNa8bAbA4g6YgMkjcCZ_8Bs2eE-Z9ZL6lzMHtxw_IGuOm7Hp63MI6JK9gvYYwfmlytmHtCi8tc5qvlIcOVmg3APyUJZcjzOimTi4mDTBYNUINOSnXxsfmSV8eJrWxTuNAUxcqgUk6iuVV9G7dQeLmvseYu6n_yyDyVOhW6kP8qCKZJLF9rs15e4E2-D_zS5ysO2U0jkuixAn-kbSnLuy9zNdrP26HU-08k-ioquJMWMkY1ftBS-mVqpKVPXhMOzrTnQNDrrfiaaTtRo61WBVWNWhjS3bvTAhHF5gpSCb7Y6FaQUXgld8L2TViLpUQyMk113f9zsuKajiSG_DlouO0oexCO0qqctjJKc1McW7U8VoRoe4liN-ldPkQ3uyPhj9YZFWE4tVQLs28AeghvyX">