Bug 12622 – Purity, @safe not checked for pointers to functions

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-04-23T00:14:00Z
Last change time
2014-05-03T13:59:04Z
Keywords
accepts-invalid, pull
Assigned to
nobody
Creator
bugzilla
Blocks
12647

Comments

Comment #0 by bugzilla — 2014-04-23T00:14:12Z
Given: void bar16(); @safe void foo16() { auto fp = &bar16; (*fp)(); // should give error bar16(); // correctly gives error } Replacing @safe with purity or @nogc, and no error is given. It does work for nothrow.
Comment #1 by k.hara.pg — 2014-04-23T03:29:56Z
Comment #2 by github-bugzilla — 2014-05-03T13:59:04Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/3b335a25c0a7627580c79c4d1c807d64b4b115b1 fix Issue 12622 - Purity, @safe not checked for pointers to functions https://github.com/D-Programming-Language/dmd/commit/3f9aba80f72e5bf87c3b8921b1d0ab8f3838df32 Merge pull request #3489 from 9rnsr/fix12622 Issue 12622 - Purity, @safe not checked for pointers to functions