[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
Thu Nov 14 21:26:14 PST 2013


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



--- Comment #2 from Denis Shelomovskij <verylonglogin.reg at gmail.com> 2013-11-15 09:26:02 MSK ---
(In reply to comment #1)
> Well, if a function has no side effect and does not produce a result or the
> result isn't used, there is no point in calling it. It's pretty harsh to demand
> that the compiler always calls such functions only to support the minor
> noreturn use-case.

Minor or no it is documented `pure` functions can throw and the compiler
already consider `pure` but not `nothrow` functions as doing this (i.e. they
aren't optimized out). So `nothrow` must be treated the same way as `nothrow`
just means no recoverable `Exception`s are thrown. Breaking language changes
are welcome but in a separate enhancement issue. Currently `onOutOfMemoryError`
is no-op because of this and the issue should be fixed.

-- 
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