summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/fail12636.d
blob: 42e785547164e9fe22ed320d1c94fda50ed70407 (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
/*
TEST_OUTPUT:
---
fail_compilation/fail12636.d(13): Error: C++ class `fail12636.C` cannot implement D interface `fail12636.D`
---
*/

interface D
{
    void foo();
}

extern(C++) class C : D
{
    extern(D) override void foo() { }
}

void main()
{
    auto c = new C;
    c.foo(); // works
    D d = c;
    d.foo(); // segfault
}