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

    <tr>
        <th>Summary</th>
        <td>
            "Invalidated the current SCC" assertion failure after #79712
        </td>
    </tr>

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

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

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

<pre>
    For the source file in https://gist.github.com/smeenai/fcd14380467e813a28f1ef8c5484b775 (reduced from a large example that uses libunifex; it's probably possible to reduce this further but I'm not at all familiar with coroutines), the following command succeeds with Clang 18 but fails with Clang 19 and trunk:

```
$ clang -c -o /dev/null coroutine_crash.cpp -std=c++20 -w
clang: llvm/lib/Analysis/CGSCCPassManager.cpp:1167: LazyCallGraph::SCC &updateCGAndAnalysisManagerForPass(llvm::LazyCallGraph &, LazyCallGraph::SCC &, LazyCallGraph::Node &, llvm::CGSCCAnalysisManager &, llvm::CGSCCUpdateResult &, llvm::FunctionAnalysisManager &, bool): Assertion `!UR.InvalidatedSCCs.count(C) && "Invalidated the current SCC!"' failed.
```

I bisected this to #79712. CC @fpasserby, @ChuanqiXu9, and @yuxuanchen1997 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyElN9u4zYTxZ-GvhnYEEeyJV3owlGgIMD3FcUGC_SuGFEjiy1NuvyTxH36gnLS7G4bFDAEWJz56fDMISkEfbLMndjfif39hlJcnO_CmdmS3oxuunaD8xAXhuCSVwyzNgzawhLjJYjyKHAQOJx0iLuTjksad8qdBQ5vDIHDrCZZlU1RHWpuZEnYzJLnRu2rphrreg8CG89TUjzB7N0ZCAz5EwO_0vliGOJCEVLgAEaPyeqZX0V5BzoKrANcvBtpNFe4uBD0mOsd3HgQFx1gTj4u7GFMER4F1mewLgJFIGNgprM2mjy86LiAct6lqC0Hga3Aft347IxxL9qeQLnzmewEISnFPIVbU2_InkA26wdm0ub79y3kluiT_T3bVdyL4v15KN5-t79YgVp7tgq2DgQOEz8LHGwy5kPar8pTWHbqcoFtiJMo75XAO4F3WMD25YZaMaI8gjHPeRhGjwKHoyVzDToIHPqHp77_mUL4P1k6sc84UR6lPNS57X_057UnYx48XZasujw-9T0IPKTLRJH7h6Od3nFviMH5DBTYrB9dm77j5Pbs6efwT1Z_chO_L3-w1y38oOGTqq-r6C8ckon_LBmSVVE7-wlrdM7kNJRHOIbAPpdCHhrKr192j_aZjM746anvw065ZKPAphfY3ggHEIjflK2ZUsl7thGe-l6gFIgC6zU7PO3-PRzr8xFGHVjdKDrkpAss67aWuIPsYVXMF8oqx2vWLqqiXxLZP_Qvac1zjqKoimt6TWTVwla2bQ2bqSuntmxpw52scV82jdzjZukqRVgfalmrwziXcuRKHZiULFoiYllvdIcFVkVblLLBVuLuwPuCxrneN-1M8yxFVfCZtNllv3fOnzY6hMSdLGpZthtDI5uwXj-Ill9gXc1-7O83vstN2zGdgqgKo0MMH5ioo-Huv6xFoL9nlu1NnoHmuE735tsmedP9eJl9c4-9n6Cs5OLdb6yiwGGVmQ_S2z6eO_wrAAD__-YUrBQ">