]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/fail_compilation/fail262.d
Add D front-end, libphobos library, and D2 testsuite.
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail262.d
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail262.d(23): Error: function fail262.B.f does not override any function
5 ---
6 */
7
8 // Issue 1645 - can override base class' const method with non-const method
9
10 import core.stdc.stdio;
11
12 class A
13 {
14 int x;
15 shared const void f()
16 {
17 printf("A\n");
18 }
19 }
20
21 class B : A
22 {
23 override const void f()
24 {
25 //x = 2;
26 printf("B\n");
27 }
28 }
29
30 void main()
31 {
32 A y = new B;
33 y.f;
34 }