[Issue 11461] `Error`s are not thrown as `pure nothrow` functions are optimized out with "-O -release"

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 22 14:59:15 PDT 2014


https://d.puremagic.com/issues/show_bug.cgi?id=11461



--- Comment #13 from monarchdodra at gmail.com 2014-03-22 14:59:11 PDT ---
Maybe the problem can be worked around by making the function(s) *weakly* pure?

(In reply to comment #11)
> (In reply to comment #7)
> > Commit pushed to master at https://github.com/D-Programming-Language/druntime
> > 
> > https://github.com/D-Programming-Language/druntime/commit/0422e58d1bd6c86063f73b9ca372e5e16afd64b0
> > Add issue 11461 workaround.
> > 
> > Issue URL: https://d.puremagic.com/issues/show_bug.cgi?id=11461
> 
> Any particular reason why "pure" isn't removed from the onOutOfMemoryError
> declaration in core.exception aswell? And for all the other error functions?

Instead of removing the "pure", which is a breaking change, since it would
prevent pure functions from having an "onOutOfMemoryError", what about my
suggestion for weak purity?

void onOutOfMemoryError(void* dummy11461 = null) @trusted pure nothrow;
or just:
void onOutOfMemoryError(void* = null) @trusted pure nothrow;
instead of
void onOutOfMemoryError() @trusted /* pure dmd @@@BUG11461@@@ */ nothrow;

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list