gcc/testsuite/gdc.test/fail_compilation/ctfe14465.d
raw| 1 | /* |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/ctfe14465.d(19): Error: uncaught CTFE exception `ctfe14465.E("message")` |
| 5 | fail_compilation/ctfe14465.d(22): called from here: `foo()` |
| 6 | fail_compilation/ctfe14465.d(22): while evaluating: `static assert(foo())` |
| 7 | --- |
| 8 | */ |
| 9 | class E : Exception |
| 10 | { |
| 11 | this(string msg) |
| 12 | { |
| 13 | super(msg); |
| 14 | } |
| 15 | } |
| 16 | |
| 17 | bool foo() |
| 18 | { |
| 19 | throw new E("message"); |
| 20 | } |
| 21 | |
| 22 | static assert(foo()); |