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

    <tr>
        <th>Summary</th>
        <td>
            Terminate handler generated for noexcept method using try/catch(...)
        </td>
    </tr>

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

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

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

<pre>
    ```
void mayThrow();

void bar() noexcept {
    try {
        mayThrow();
    } catch (...) {}
}
```
This code generates a call to `__clang_call_terminate` which seems like unnecessary code bloat (https://godbolt.org/z/eKbGq9xjP) 
The same code with GCC doesn't generate the call to terminate (https://godbolt.org/z/bT1vMa7a3)

According to cppreference, `catch(...)` should guarantee that no exception escapes the function so this `__clang_call_terminate` code section shouldn't be required.

https://en.cppreference.com/w/cpp/language/try_catch
```
Catch-all block may be used to ensure that no uncaught exceptions can possibly escape from a function that offers nothrow exception guarantee.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMlMGO4ygQhp8GX0pt2cSOOwcferrlOaxW2kPfIwwVwwwGDwWdyT79Cidy0qPd1USRElFU1V9f_UIQmckh9qz9wtq3QqSofehJC5dm4SKSLEavLj3bV7dv9caqlw9vFMzi8q6DPzP-zPiB7b5cYw83RhGuQXAef0pcIrDudg0AIIbL54P8-Y-yOcS6N5AiSg2MP5dlmSvn_O7t1nr781nuuzYE0iuECR0GEZFAgBTWQvTA9tXxKK1w0zEfHSOG2TgRke0rOGsjNRDiTGDNd4TkHEokEuFyLTlaL2IWpGNciO1eGB8YHyavRm9j6cPE-PA34wP-MX79cfj57a9V9k0YAokZr5XOJmr4-voKyiM5xru46YWocRO8CfydruN7_fGn6MQuw3xY0IuUPijjplxRLkvAEwZ0Ehl_zUhWzhvmjIK0T1bBlETI1siaRATn4bpa4x0gSbEgrWpPycn1kDzEvID_5bwCILxlrJ2uBEaEgD-SCajKR_2f50ZXPs5QSj8zPpwZH-SyMD7krklMyPgQw-V4He7frPKaI08Z9Gi9_J7dmCUkQpVBoaMU7pMnJ0WadLwjIJDCweKJzGgvNyBwCn4GcUey5vvTCQOB8zHb_YHiRrj8RWKh-p067A6iwL7ed01dtU3NC923TaXkrsaDENi2Arvnpm26rhPYSTWqsTA9r_iuqutD1db7lpcN70bVSHUYZY2nU8OaCmdhbGntx5ztUxiihP2-qneHwooRLa2vBOcOz7AGGef50Qh9znka00SsqayhSPcq0USL_fvmWC2cshg2Yys4-XB_HmaM2itItBozXPICPxmxSMH2v3jeRJ3G28pz49vP0xL8N5SR8WGVS4wP6zj_BAAA___BVJUq">