compiler-explorer
compiler-explorer copied to clipboard
[BUG] /EHc is forced on C++ MSVC
Describe the bug
Compiler Explorer forces /EHc
even if /EHs
is explicitly set.
To Reproduce
extern "C" void foo() {
throw 1;
}
static_assert(noexcept(foo()), "");
Try to compile this on any MSVC with /EHs
.
Expected behavior
I would expect that /EHs
does its job.
Link https://godbolt.org/z/3nhYoezP1
Screenshots n.a.
Desktop n.a.
Additional context
The issue can be mitigated by compiling with /EHc- /EHs
, as explained in this answer on stackoverflow.
@mattgodbolt If you have any ideas here Im all ears. My personal thought is we shouldn't pass any hidden flags ever. Anything we do by default should so up in the compiler options dialog box so everyone knows they are being set.