Retro68/gcc/libphobos/testsuite/libphobos.exceptions/line_trace.d
Wolfgang Thaller 6fbf4226da gcc-9.1
2019-06-20 20:10:10 +02:00

20 lines
301 B
D

// { dg-output "object.Exception@.*: exception" }
void main()
{
try
{
f1();
}
catch (Exception e)
{
import core.stdc.stdio;
auto str = e.toString();
printf("%.*s\n", str.length, str.ptr);
}
}
void f1()
{
throw new Exception("exception");
}