http://d.puremagic.com/issues/show_bug.cgi?id=6205
Summary: Strongly-pure nothrow functions with ignored return
value are entirely stripped even if it contains a
failing 'assert'.
Product: D
Version: D2
Platform: Other
OS/Version: Mac OS X
Status: NEW
Keywords: wrong-code
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from [email protected] 2011-06-24 01:05:51 PDT ---
Test case:
---------------------------
int x() pure nothrow {
assert(false, "1");
}
void main() {
x();
}
---------------------------
This should throw an AssertError, but instead the generated program does
nothing. The AssertError will be thrown if the return value of 'x' is assigned
to some variable though.
This bug (?) causes 'runnable/test41.d' to fail since commit 4c9661f as nothrow
inference is also implemented, making 'imports.test41a.func' a strongly-pure
nothrow function, and the 'assert' inside fails to run.
https://github.com/D-Programming-Language/dmd/commit/4c9661fa9fbd427909a334133dfc7f3869e47c31
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------