You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace throw() with _NOEXCEPT defined in libcxx (#10787)
This deletes `_NOTHROW` defined in libcxxabi by #10577 and uses
`_NOEXCEPT` already defined in libcxx/include/__config. This also
replaces some existing `throw()`s with `_NOEXCEPT`. `_NOEXCEPT` becomes
`noexcept` when it is available, i.e., this is C++11 or above, and falls
back to `throw()` if not.
The current libcxx/libcxxabi is a bit messy that many parts of
libcxx/libcxxabi are already using this `_NOEXCEPT` but not all of them.
This replaces most `throw()` with `_NOEXCEPT` but leaves some `throw()`,
the ones in files that are not built at all by Emscripten or not used
by wasm EH, to reduce deviations from the original library.
This is mostly for wasm EH to work because wasm EH does not support
exception specifications yet and does not have a short-term plan to
support it, but I think this is better in general (because exception
specification is deprecated already in C++11 and will be removed later)
and does not change semantics for users. Also, for many changes in
function declarations in the headers of libcxx here, their corresponding
definitions in cpp files are already using `_NOEXCEPT`. (Turns out
compiler considers `void foo() throw();` as a valid declaration for the
function body `void foo() noexcept { ... }`)
I'm planning to make a Clang change that ignores exception
specifications for wasm for a temporary measure (Windows frontend
ignores it too, so that shouldn't be a very serious problem for now). So
after this PR and that Clang change, Wasm EH will use `noexcept` with
C++11 or above and will ignore `throw()` in C++03 or below.
0 commit comments