Bug 6109 – 'nothrow' does not check slice indices

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2011-06-05T12:05:00Z
Last change time
2011-06-06T00:38:37Z
Keywords
accepts-invalid, patch
Assigned to
nobody
Creator
kennytm

Comments

Comment #0 by kennytm — 2011-06-05T12:05:58Z
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.
Comment #1 by kennytm — 2011-06-05T13:33:47Z
The regression was introduced in commit 62610eb. https://github.com/D-Programming-Language/dmd/commit/62610eb
Comment #2 by kennytm — 2011-06-05T14:18:02Z
Comment #3 by bugzilla — 2011-06-06T00:38:37Z