summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/test18385b.d
blob: f0b9d014f8416a51fc1ef1e3902178abb5f53cf9 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
Previous implementation raised errors for overloads using alias declarations
because they ignored the actual function name

TEST_OUTPUT:
---
fail_compilation/test18385b.d(13): Error: `test18385b.S.foo` called with argument types `(int)` matches both:
fail_compilation/test18385b.d(8):     `test18385b.S.foo(int s)`
and:
fail_compilation/test18385b.d(3):     `test18385b.foo(int s)`
fail_compilation/test18385b.d(102): Error: `test18385b.bar` called with argument types `(int)` matches both:
fail_compilation/test18385b.d(2):     `test18385b.bar(int s)`
and:
fail_compilation/test18385b.d(3):     `test18385b.foo(int s)`
---
*/
#line 1

void bar(int s) {}
void foo(int s) {}
alias bar = foo;

struct S
{
	void foo(int s) {}
	alias foo = bar;

	void useEm()
	{
		foo(1);
	}
}

// False positive in mutex.d when building druntime
class Mutex
{
	this() {}
	this() shared {}
	this(Object obj) {}
}

#line 100
void main()
{
	bar(0);
	new Mutex();
}