Summary: Allow dup in nothrow functions
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: druntime

--- Comment #0 from 2011-03-04 15:09:52 PST ---
In DMD 2.052 it's allowed to create a new dynamic array inside nothrow
functions, this compiles and works:

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

But this almost equivalent code isn't accepted:

nothrow void foo(int[] a) {
void main() {}

DMD 2.052 shows:
test.d(2): Error: _adDupT is not nothrow
test.d(1): Error: function 'foo' is nothrow yet may throw

I suggest to let it accept the dup inside nothrow functions too.

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

Reply via email to