diff 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 diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tangotests/fail/q.d	Tue May 06 07:26:27 2008 +0200
@@ -0,0 +1,22 @@
+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;
+}