Thread overview
[Bug 156] New: Inheriting nested classes and "-inline" throws access violation
May 24, 2006
d-bugmail
Jun 01, 2006
Thomas Kuehne
Jun 04, 2006
Markus Dangl
Jun 05, 2006
d-bugmail
May 24, 2006
http://d.puremagic.com/bugzilla/show_bug.cgi?id=156

           Summary: Inheriting nested classes and "-inline" throws access
                    violation
           Product: D
           Version: 0.157
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: sky@quit-clan.de


The following code throws an access violation when compiled with "-inline". It works fine with other compiler flags.

------------------------------------------

module nestedclass2;

private import std.stdio;

class Foo
{
    class Bar
    {
        void doSayHello()
        {
            sayHello();
        }
    }
    Bar bar;

    void sayHello()
    {
        writefln("Hello");
    }

    this()
    {
        bar = new Bar();
    }
}

class Foo2 : Foo
{
}

int main(char[][] argv)
{
    Foo2 foo = new Foo2();
    writefln("This should print Hello:");
    foo.bar.doSayHello();

    return 0;
}


-- 

June 01, 2006
d-bugmail@puremagic.com schrieb am 2006-05-24:
> http://d.puremagic.com/bugzilla/show_bug.cgi?id=156

> The following code throws an access violation when compiled with "-inline". It works fine with other compiler flags.
>
> ------------------------------------------
>
> module nestedclass2;
>
> private import std.stdio;
>
> class Foo
> {
>     class Bar
>     {
>         void doSayHello()
>         {
>             sayHello();
>         }
>     }
>     Bar bar;
>
>     void sayHello()
>     {
>         writefln("Hello");
>     }
>
>     this()
>     {
>         bar = new Bar();
>     }
> }
>
> class Foo2 : Foo
> {
> }
>
> int main(char[][] argv)
> {
>     Foo2 foo = new Foo2();
>     writefln("This should print Hello:");
>     foo.bar.doSayHello();
>
>     return 0;
> }

Added to DStress as http://dstress.kuehne.cn/run/i/inline_16_A.d http://dstress.kuehne.cn/run/i/inline_16_B.d http://dstress.kuehne.cn/run/i/inline_16_C.d

Thomas


June 04, 2006
> Added to DStress as
> http://dstress.kuehne.cn/run/i/inline_16_A.d
> http://dstress.kuehne.cn/run/i/inline_16_B.d
> http://dstress.kuehne.cn/run/i/inline_16_C.d
> 
> Thomas

Thanks for all the effort you're putting into DStress!
June 05, 2006
http://d.puremagic.com/bugzilla/show_bug.cgi?id=156


bugzilla@digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #1 from bugzilla@digitalmars.com  2006-06-04 22:16 -------
Fixed in DMD 0.160


--