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

    <tr>
        <th>Summary</th>
        <td>
            [llvm-ar] Replace operation can silently convert a regular archive to a thin archive
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            tools:llvm-ar/llvm-ranlib
      </td>
    </tr>

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

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

<pre>
    In the following test-case:

```
:~/tests$ echo "void foo(){}" > foo.c
:~/tests$ gcc -c foo.c
:~/tests$ llvm-ar qc q.a foo.o
:~/tests$ llvm-ar rT q.a foo.o
```

The output should be:
`error: Cannot convert existing library q.a to thin format`

Instead, llvm-ar silently converts the existing archive to a thin archive.

This bug appears to exist in all current releases, including llvm14.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyFUtFu3CAQ_Br8gs6ysX2uH_zQ5HJSXqv8AOA9m4oDZ4Fr7--7OJe0TZRWQljsDrMzg5WfruOj43EBfvLW-h_GzTxCiDstA7DmK6sOrHrd99VtvRyp2z8wccz4wETLQS-eMyEu3kzE55n4wsTA-jvWH6jMWfOQy6X-jGDWmu_0vzHWXs47ifxZ8-dSblj_Pyw-fcC-87LtTxSDT3FNkYfFJztx9UcG-woQPVKB30vnfOTauwtg5PDThJiTs0ahxOs2LHqK1TgaimcZ3016dCGCnJi4f9MYjAUX7fWVNWyv8kYtUS_mAplWvhDfKuXfDkzgKhF8XUFiyPCNgucL1nKdEGkMR7BALxyyAuO0TdOmn7TUbVlMYzMNzSCLaKKFkXV3N5WsO_BvsFqpKakVUEbjHdfSfZBPKhHmZMnZp9KLhHZcYlxDTlkcac0mLkmV2p_pkIfePrsV_XfQkY4mhJSFH7uuE32xjGLfaFnpAVQNegIQlVBtPfSnodaDbtrCSgU2ZBv0F0bvbZ736ujGj9LR61GfLBZmJA5RdXVfDV3f9qXsG3GSnahVexJT37G2grM0tsx3S49zgeNGQ9kHalqKPPxuyhDM7GBLMvPLFBePo5pI5V6hCcVmatwc_QIkvyGt">