Bug 13120 – Body of `foreach` over string with transcoding ignores function attributes

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-07-13T08:45:00Z
Last change time
2015-02-18T03:37:38Z
Keywords
accepts-invalid, pull
Assigned to
nobody
Creator
verylonglogin.reg

Comments

Comment #0 by verylonglogin.reg — 2014-07-13T08:45:36Z
This code should NOT compile: --- void f() { } void g(char[] s) pure @nogc { foreach(dchar dc; s) f(); } --- The behaviour above is correct for `@safe` attribute, but this attribute fails in case of a template. This code should NOT compile: --- void f() { } void g()(char[] s) { foreach(dchar dc; s) f(); } void h() @safe pure @nogc { g(null); } ---
Comment #1 by k.hara.pg — 2014-09-07T10:12:52Z
Comment #2 by github-bugzilla — 2014-09-08T18:32:04Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/96abecdd6e694e2dcfd62ab96329129871f6efed Supplemental fix for issue 13120 - remove accidentally accepted @nogc attribute `removechars()` and `squeeze()` are not @nogc, because they uses `dup` and `std.utf.encode`. https://github.com/D-Programming-Language/phobos/commit/fc84b758f49c1385bb8357b0fb27833654397300 Merge pull request #2493 from 9rnsr/fix13120 Supplemental fix for issue 9148 and 13120
Comment #3 by github-bugzilla — 2014-11-13T10:59:30Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/e40077c82dbedc2920379053f3fea7ae89a56f73 fix Issue 13120 - Body of `foreach` over string with transcoding ignores function attributes https://github.com/D-Programming-Language/dmd/commit/49aad3d10ec7693c8f115e8a57f1f1fd4f0746e9 Merge pull request #3956 from 9rnsr/fix13120 Issue 13120 - Body of `foreach` over string with transcoding ignores function attributes
Comment #4 by github-bugzilla — 2015-02-18T03:37:38Z
Commits pushed to 2.067 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/e40077c82dbedc2920379053f3fea7ae89a56f73 fix Issue 13120 - Body of `foreach` over string with transcoding ignores function attributes https://github.com/D-Programming-Language/dmd/commit/49aad3d10ec7693c8f115e8a57f1f1fd4f0746e9 Merge pull request #3956 from 9rnsr/fix13120