Debian Codegraph @

gcc/testsuite/gdc.test/fail_compilation/test18385.d

raw
1 /*
2 REQUIRED_ARGS: -de
3 TEST_OUTPUT:
4 ---
5 fail_compilation/test18385.d(13): Error: function `test18385.foo` cannot overload `extern(C)` function at fail_compilation/test18385.d(12)
6 ---
7 */
8
9
10 extern (C):
11
12 void foo(int) { }
13 void foo(double) { }
14
15 struct S
16 {
17 static void foo(int) {}
18 static void foo(double) {}
19 }
20
21 void foo2(int) { }
22 extern(D) void foo2(double) { } // OK as it has a different mangling
23
24 void foo3(int) { }
25 void foo3(double); // duplicate declarations are allowed
26
27 void foo4();
28 void foo4() { }
29
30 extern(D) void foo5();
31 extern(D) void foo5() { }