Summary: Dyn array allocations can be allowed in nothrow
           Product: D
           Version: 2.040
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2010-02-28 14:06:51 PST ---
This program performs a memory allocation, so it can throw an out of memory
error. But such exceptions are now meant to be not recoverable, so I think
allocating memory can now be done in nothrow functions too.

But currently with the following code the compiler prints at compile time:
test2.d(1): Error: function 'foo' is nothrow yet may throw

nothrow void foo() {
    auto a = new int[5];
void main() {}

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to