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

    <tr>
        <th>Summary</th>
        <td>
            [Clang] ICE with forward declares and modules
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

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

<pre>
    Here is my best reduction to reproduce. This error has occurred for me on both 20.1.7 and 20.1.8. Interestingly, it does not reproduce on my self-built clang in either Debug or Optimized. Only occurs on the binary from arch repo, so not sure how to go about debugging this.

render_impl.cpp
```
module lotus:render.impl;

import std;
import :GameObject;
import :State;
import :render;
import :programs;

void BasicTriangleDrawer::draw(State *state) {
    std::vector<float> vertices;
 vertices.reserve(state->objs.size());
}
```

GameObject.ixx
```
export module lotus:GameObject;

export class GameObject {};
```

Render.ixx
```
export module lotus:render;

import std;
import :State;

export class BasicTriangleDrawer {
  public:
 void draw(State *state);
};
```

programs.ixx
```
export module lotus:programs;

export namespace zzz {}
```

</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMVMGOozgQ_RpzKTUiBgZy4JDudHbn1NLu3FfGrgbPGoyqTNLJ169MmE5PdnbVElGgXPVe1XtWKWbbjYiNKB9FuU_UHHpPzd-W-82YtN6cm9-RECzDcIYWOQChmXWwfoTggXAib2aNKXzrLQMSeYJeMXitZyI08OoJBgQ_QutDDzJLN2kFajTX1zqFr2NAQg527NxZyCewAYxHhtGHG0NEGM7A6F4f2tm6ANqpsQM7AtrQI8Ee27kDT_AyBTvYC5oUXkZ3vvbCESD0CK0dFZ3hlfwAinQfKXykZb8w8kwIvT_F-ToPqvVzABOxOzt2EHrLqch2ItsRjgbpLztMLtXTFINfsvXJdoM3s0NwPsws8jU5jckif7wC2GHyFICDuYbWb5HvflMDvrTfUYf7kz-DCngfvILfRyfyHamB3_mO3hp4VGz1N7Jq7BzuSZ1i4U7kO0PqJGS9EICQO16Y5BZEFesB4NppzD2iDp5E_vTqvAoif4YjUrAaV7L3z5SQkY4oZL3gPYj82bffOWV7iUEht_G5dljt7zQU2QclUvv2dneOb8usd1Lfi3dL1E4xw-18Ga3ar2k_E_-xGvZJ0o8W_K-1Hwy8b-wX1ryLP82tszqqH9WNRv6XXzcxfzXWj0vx6cH-dYvWtFENyJPSCJfL5YeQPwMmpsnNNt-qBJtNVeaFrIttnfSNrnXRVvUXU-VmYzDbVogFapRZZdBgkdhGZrLMquVXb-o0L7dYGlnWmSk2lSxEkeGgrEudOw6ppy6xzDM2mzIr603iVIuOl7Um5bIohJRxw1ETCx7auWNRZM5y4BtEsMEtu_BpqSj38PXpGU429HGNnRQZMKidIuRlg12V4mQm1_QhTFEuIQ9CHjob-rlNtR-EPET89e9hIr9cTHlY-mUhD2vLx0b-EwAA__-UkMNH">