http://d.puremagic.com/issues/show_bug.cgi?id=6287

           Summary: function pointers to non-static function without an
                    object-instance
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: suicide...@xited.de


--- Comment #0 from suicide...@xited.de 2011-07-11 09:32:15 PDT ---
----
import std.stdio;

struct test
{
    int foo(int k) //forgot to defined as static
    {
        return k;
    }
}

int main(string[] argv)
{
    int function(int) fp;

    fp = &test.foo; //this should not be possible, as foo is not static. it
allows dirty hacks, though.
    int x = fp(99);
    writeln(x);    
   return 0;
}
----

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to