Debian Codegraph @

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

raw
1 /*
2 Previous implementation raised errors for overloads using alias declarations
3 because they ignored the actual function name
4
5 TEST_OUTPUT:
6 ---
7 fail_compilation/test18385b.d(13): Error: `test18385b.S.foo` called with argument types `(int)` matches multiple overloads exactly:
8 fail_compilation/test18385b.d(8): `test18385b.S.foo(int s)`
9 and:
10 fail_compilation/test18385b.d(3): `test18385b.foo(int s)`
11 fail_compilation/test18385b.d(102): Error: `test18385b.bar` called with argument types `(int)` matches multiple overloads exactly:
12 fail_compilation/test18385b.d(2): `test18385b.bar(int s)`
13 and:
14 fail_compilation/test18385b.d(3): `test18385b.foo(int s)`
15 ---
16 */
17 #line 1
18
19 void bar(int s) {}
20 void foo(int s) {}
21 alias bar = foo;
22
23 struct S
24 {
25 void foo(int s) {}
26 alias foo = bar;
27
28 void useEm()
29 {
30 foo(1);
31 }
32 }
33
34 // False positive in mutex.d when building druntime
35 class Mutex
36 {
37 this() {}
38 this() shared {}
39 this(Object obj) {}
40 }
41
42 #line 100
43 void main()
44 {
45 bar(0);
46 new Mutex();
47 }