[Issue 12622] New: Purity, @safe not checked for pointers to functions

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Apr 22 17:14:12 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=12622

          Issue ID: 12622
           Summary: Purity, @safe not checked for pointers to functions
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: bugzilla at digitalmars.com

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.

--


More information about the Digitalmars-d-bugs mailing list