summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/fail187.d
blob: b985493d5fd8c87504b4f1e8f880f2b154bc2ebd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// REQUIRED_ARGS: -d
/*
TEST_OUTPUT:
---
fail_compilation/fail187.d(16): Error: catch at fail_compilation/fail187.d(20) hides catch at fail_compilation/fail187.d(24)
---
*/

// On DMD 2.000 bug only with typedef, not alias

alias Exception A;
alias Exception B;

void main()
{
    try
    {
        throw new A("test");
    }
    catch (B)
    {
        // this shouldn't happen, but does
    }
    catch (A)
    {
        // this ought to happen?
    }
}