[Issue 6109] New: 'nothrow' does not check slice indices

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 5 12:10:27 PDT 2011


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

           Summary: 'nothrow' does not check slice indices
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Keywords: accepts-invalid
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: kennytm at gmail.com


--- Comment #0 from kennytm at gmail.com 2011-06-05 12:05:58 PDT ---
Test case:
-----------------------------------------
int bug6109throwing() {
    throw new Exception("throws");
}
int bug6109noThrow() nothrow {
    auto g = [4][bug6109throwing() .. 1];
    return 0;
}
-----------------------------------------


This should not compile since 'bug6109throwing' is not 'nothrow', but DMD
currently accepts it. It is expected that the compiler to give an error of

x.d(4): Error: function x.bug6109noThrow 'bug6109noThrow' is nothrow yet may
throw

The bug does not exist in 2.048.

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