| 1 |
/* |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/test12558.d(32): Deprecation: `catch` statement without an exception specification is deprecated |
| 5 |
fail_compilation/test12558.d(32): use `catch(Throwable)` for old behavior |
| 6 |
fail_compilation/test12558.d(36): Deprecation: `catch` statement without an exception specification is deprecated |
| 7 |
fail_compilation/test12558.d(36): use `catch(Throwable)` for old behavior |
| 8 |
fail_compilation/test12558.d(43): Deprecation: `catch` statement without an exception specification is deprecated |
| 9 |
fail_compilation/test12558.d(43): use `catch(Throwable)` for old behavior |
| 10 |
fail_compilation/test12558.d(47): Deprecation: `catch` statement without an exception specification is deprecated |
| 11 |
fail_compilation/test12558.d(47): use `catch(Throwable)` for old behavior |
| 12 |
fail_compilation/test12558.d(56): Deprecation: `catch` statement without an exception specification is deprecated |
| 13 |
fail_compilation/test12558.d(56): use `catch(Throwable)` for old behavior |
| 14 |
fail_compilation/test12558.d(31): Error: `catch` statement without an exception specification is deprecated |
| 15 |
fail_compilation/test12558.d(31): use `catch(Throwable)` for old behavior |
| 16 |
fail_compilation/test12558.d(36): Error: `catch` statement without an exception specification is deprecated |
| 17 |
fail_compilation/test12558.d(36): use `catch(Throwable)` for old behavior |
| 18 |
fail_compilation/test12558.d(42): Error: `catch` statement without an exception specification is deprecated |
| 19 |
fail_compilation/test12558.d(42): use `catch(Throwable)` for old behavior |
| 20 |
fail_compilation/test12558.d(47): Error: `catch` statement without an exception specification is deprecated |
| 21 |
fail_compilation/test12558.d(47): use `catch(Throwable)` for old behavior |
| 22 |
--- |
| 23 |
*/ |
| 24 |
|
| 25 |
void main() |
| 26 |
{ |
| 27 |
auto handler = () { }; |
| 28 |
|
| 29 |
try { |
| 30 |
assert(0); |
| 31 |
} catch |
| 32 |
handler(); |
| 33 |
|
| 34 |
try { |
| 35 |
assert(0); |
| 36 |
} catch { |
| 37 |
handler(); |
| 38 |
} |
| 39 |
|
| 40 |
try { |
| 41 |
assert(0); |
| 42 |
} catch |
| 43 |
handler(); |
| 44 |
|
| 45 |
try { |
| 46 |
assert(0); |
| 47 |
} catch { |
| 48 |
handler(); |
| 49 |
} |
| 50 |
} |
| 51 |
|
| 52 |
void foo()() |
| 53 |
{ |
| 54 |
try {} |
| 55 |
catch |
| 56 |
assert(false); |
| 57 |
} |