view tangotests/fail/q.d @ 172:68a7dd38c03c trunk

[svn r188] Fixed using a dereferenced pointer argument as both l- and r-value. fixes tango.io.FileRoots. Reorganized the tangotests dir a bit.
author lindquist
date Tue, 06 May 2008 07:26:27 +0200
parents tangotests/q.d@0dec7b3727ea
children
line wrap: on
line source

class E : Exception
{
    this(char[] msg)
    {
        super(msg);
    }

    char[] toString()
    {
        return super.toString();
    }
}

extern(C) int printf(char*, ...);

void main()
{
    auto e = new E("hello world");
    auto msg = e.toString();
    printf("message should be: '%.*s'\n", msg.length, msg.ptr);
    throw e;
}