summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/cppeh2.d
blob: 1d3ddc67e7f9200509837a85e02d534428c97bfb (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
29
30
31
32
33
// DISABLED: win32 win64
/*
TEST_OUTPUT:
---
fail_compilation/cppeh2.d(21): Error: cannot mix catching D and C++ exceptions in the same try-catch
---
*/

version(Windows) static assert(0, "This test should not run on this platform");

extern (C++, std)
{
    class exception { }
}

void bar();
void abc();

void foo()
{
    try
    {
        bar();
    }
    catch (std.exception e)
    {
        abc();
    }
    catch (Exception e)
    {
        abc();
    }
}