gcc/testsuite/gdc.test/compilable/test23431_minimal.d
raw| 1 | // https://issues.dlang.org/show_bug.cgi?id=23431 |
| 2 | // REQUIRED_ARGS: -lowmem |
| 3 | module object; |
| 4 | |
| 5 | alias string = immutable(char)[]; |
| 6 | class Throwable { } |
| 7 | class Exception : Throwable |
| 8 | { |
| 9 | this(string ) |
| 10 | { |
| 11 | } |
| 12 | } |
| 13 | |
| 14 | class Error { } |
| 15 | |
| 16 | // Needed to lower `new Exception("ice")` to it. |
| 17 | T _d_newclassT(T)() |
| 18 | if (is(T == class)) |
| 19 | { |
| 20 | return null; |
| 21 | } |
| 22 | |
| 23 | void test23431() |
| 24 | { |
| 25 | int a; |
| 26 | |
| 27 | try |
| 28 | { |
| 29 | throw new Exception("test1"); |
| 30 | a++; |
| 31 | } |
| 32 | finally |
| 33 | { |
| 34 | } |
| 35 | } |