[Issue 14448] New: Compiler crashes when getting the address of a function in MemberFunctionTuple

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Apr 14 05:05:20 PDT 2015


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

          Issue ID: 14448
           Summary: Compiler crashes when getting the address of a
                    function in MemberFunctionTuple
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: critical
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: ziofu1 at gmail.com

module test;

class Foo
{
    void foo()
    {
        import std.traits;

        alias funs = MemberFunctionsTuple!( typeof( this ), "bar" );

        void function( string ) b = &funs[ 0 ];

        b( "world" );
    }

    void bar( string s )
    {
        import std.stdio;
        writeln( "hello ", s );
    }
}

void main()
{
    auto f = new Foo();
    f.foo();
}


On Ubuntu (but it has been tested on windows too )

dmd test.d 

causes segmentation fault

--


More information about the Digitalmars-d-bugs mailing list