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

    <tr>
        <th>Summary</th>
        <td>
            Clang linking error
        </td>
    </tr>

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

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

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

<pre>
    I am writing a toy vm for an imaginary cpu architecture. I have a fairly large struct with unions in it to define all of the registers. My entire program is in one file. When adding a few functions and a few values to the struct it suddenly stopped compiling because the registers struct was undefined even though there is only one source file and it doesnt include ANY libraries, not even standard ones. when using -c flag it stopped complaining and compiled fine however.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxVkkuPnDAQhH8NXFqLwDDMzIHDZqOV9pBcoxwb3EBvPDbygxH_Pg2zm4eEBMZU1Vdueqe37g3wBnfPke0ECNFtsN5gdB7QAt9wYot-g2FJgH6YOdIQk6cC3mDGlUQyInuzgUE_EYTo0xDhznGGZNnZACw-UYxB08hWFMaAGyHOBJ4mDpF8KODbBmQje4LFu8kLFB9SJ4qRjQT-mMkCav0AHekOY7JDPDLQ6o93K5pEYY_bAz5wJD8krckKZ4huWUjD4G4Lm92spwFToP-J_jTBIEUe6BpoFYY4uzTN--dCK5Rut905g0t-eOAeRBKrHQUrAHYwSRM8f_8JhnuPnilk6gWsiw_TEEWBXu9Gchz3vWwKO97TAKPB6SjxD7tBtsdR2M8usnEc8OzuYumLnLqqba9VW6u2zHVX62t9xTxyNNS9GBSx9P-1m5D3zufJm26OcQlZ_ZypV7kmmWPqC_GXhTHr5-1JhvQuf4IsOYS0d3k9XaumyueO-lI3_eXat825xzNV5TCeazq3VzVQj5fcYE8mdNnpS6aUlZkdFvKcnb7m3KlSqapSdVmqU3MqyrKhSo8X1Z5bVNWYNSXdkE2xcxTOT7nvDqQ-TUE2jcwv_N3EEHiyREec-GOS8YmCjdkMr_mR3R3svwGwEBE0">