<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/147515>147515</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Clang] -fno-exceptions not respected in combination with -fopenmp
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
kalvdans
</td>
</tr>
</table>
<pre>
I tried to compile
```
#include <stdexcept>
int f() {
throw std::invalid_argument("hej");
}
```
with `clang -O2 -fopenmp -fno-exceptions -c test.cpp` and it works. If I remove the `-fopenmp` flag it correctly fails since we can't throw without exceptions being turned on.
Reproduced on (godbolt)[https://godbolt.org/z/5zvP5aWdM] with clang-19.1.0 and clang-20.1.0. Not reproducable with gcc 15.1.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxkkstu4zoMhp-G3hA2ZDmKnYUXaXMCdHEuOJtZDmSJttUqkiHJybRPP5CTYgYdQIAA3n5-JGWMZnJEPYgnEKdCrmn2oX-T9qqli8Xg9Xv_gikY0pg8Kn9ZjCVgR9izx2NH4I1xyq6aEJrnmDT9ULQkaP7KTnY0LuEIvAN-QGifgB0REdMc_A1j0tAcoTkad5XW6O8yTOuFXNri-UyvwDnwAzQ5D9rTF-2bSTPCnikr3YTlvxzL0S_kLguWo_PlvRXjXcRSYaKYKrUssGconUaT8ObDW6zwZcQXDHTxV8I0Uy75WSgHj1ZOOVr5EEgl-46jNDZiNE4R3giVdMDb9KDKXfk14W_qAxk3YVqDI43eVffR_E9L8HpVmw2Bd5PXg7cpE4unOaUl5vHwM_Dzw1X5MAE_fwA_i4_rf0J-03-DOG2auI2hrA9VXd0J7wbOsqHCf3zC8JCUg6V70qQU1qKqq0L3jT40B1lQX7eiPrRd29XF3Hdy7Jga2v3QjGrPxdDu9gOxkRjvRC3awvScccFa1tV8t-d1NdS6lg0Th4FIdUzDjtFFGltZe71khMLEuFJf71pRi8LKgWzczpDzree8dnEqQp8TymGdIuyYNTHFXyWSSXa73ectQ5z-2LnbgONCKpFG4_IFD8bJ7L3Df265WIPtvwzcpHkdKuUvwM9Z9PGVS_CvpBLw8wYRgZ8fHNee_wwAAP__X2EOcA">