]>
Commit | Line | Data |
---|---|---|
b4c522fa IB |
1 | // REQUIRED_ARGS: |
2 | /* | |
3 | TEST_OUTPUT: | |
4 | --- | |
5 | compilable/test12558.d(16): Deprecation: catch statement without an exception specification is deprecated; use catch(Throwable) for old behavior | |
6 | compilable/test12558.d(21): Deprecation: catch statement without an exception specification is deprecated; use catch(Throwable) for old behavior | |
7 | --- | |
8 | */ | |
9 | ||
10 | void main() | |
11 | { | |
12 | auto handler = () { }; | |
13 | ||
14 | try { | |
15 | assert(0); | |
16 | } catch | |
17 | handler(); | |
18 | ||
19 | try { | |
20 | assert(0); | |
21 | } catch { | |
22 | handler(); | |
23 | } | |
24 | ||
25 | // ensure diagnostics are not emitted for verioned-out blocks | |
26 | version (none) | |
27 | { | |
28 | try { | |
29 | assert(0); | |
30 | } catch // should not emit diagnostics | |
31 | handler(); | |
32 | ||
33 | try { | |
34 | assert(0); | |
35 | } catch { // ditto | |
36 | handler(); | |
37 | } | |
38 | } | |
39 | } |