[Issue 3020] No description is given why function may not be nothrow

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Oct 29 10:30:35 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=3020



--- Comment #8 from Walter Bright <bugzilla at digitalmars.com> 2010-10-29 10:29:39 PDT ---
(In reply to comment #7)
> In the existing compiler, they are disallowed. 

That's a bug.

> ( void foo() nothrow { auto x = new int; }  won't compile).
> I just added error messages to specify why it was being disallowed.
> It sounds as though the check for nothrow violations should be separated from
> the code which determines if a statement can throw. That is, for 'new' and for
> asm, we assume that it can throw. But, if it's in a nothrow function, we trust
> the programmer.
> Then, what happens if an out of memory condition happens in a nothrow function?
> Is the program simply terminated?

Yes.

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


More information about the Digitalmars-d-bugs mailing list