HDembinski / HDembinski.github.io

Write-ups
MIT License
22 stars 5 forks source link

Clang and noexcept #1

Closed degski closed 4 years ago

degski commented 4 years ago

Nice write-up.

Clang-10 does not blindly trust the noexcept specifier and warns at compile-time. It also finds (warns on) destructors that (transitively) throw, while not being marked noexcept(false).

d.

HDembinski commented 4 years ago

Hi degski, thank you for this detail and for reading my essay! I will fix it.

HDembinski commented 4 years ago

I clarified this in the text. It turns out that I was not wrong, both gcc and clang detect the obvious case, but it is sufficient to wrap the throw in a nested function to get "rid" of the warning.