[Issue 21598] New: checkaction=context reruns pure functions with debug blocks on failure
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Jan 31 14:57:30 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=21598
Issue ID: 21598
Summary: checkaction=context reruns pure functions with debug
blocks on failure
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: moonlightsentinel at disroot.org
===========================================
extern(C) int puts(const scope char*);
void main()
{
assert(foo(1));
}
int foo(int i) pure nothrow
{
debug puts("Hello");
return i - 1;
}
============================================
Currently outputs:
Hello
Hello
This is caused by dmd omitting the temporary for pure function calls
(op.hasSideEffect == false).
--
More information about the Digitalmars-d-bugs
mailing list