www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12622] New: Purity, safe not checked for pointers to functions

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 puremagic.com
          Reporter: bugzilla 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.

--
Apr 22 2014