Comment #0 by moonlightsentinel — 2021-03-28T23:26:54Z
The following code passes when compiled with -release but fails when adding -checkaction=context:
----------------------------------------------
int boo()
{
assert(false);
}
void main()
{
assert(boo()); // Should be omitted
}
----------------------------------------------
dmd -release -run test.d => Success
dmd -release -checkaction=context -run test.d => Failure
Comment #1 by dlang-bot — 2021-03-29T01:16:02Z
dlang/dmd pull request #12315 "Fix 21779 - Don't generate messages for disabled assertions" was merged into master:
- e2320afc2b8eb7109d8c87706433e1cb74a763c5 by MoonlightSentinel:
Fix 21779 - Don't generate messages for disabled assertions
Only generate messages when the assert is not omitted due to `-release`
or `-check=assert=off`. The rewrite to create a temporary seems to
prevent the ellision (and is a waste of time anyways).
https://github.com/dlang/dmd/pull/12315