]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gdc.test/fail_compilation/bug8891.d
d: Merge upstream dmd, druntime 4574d1728d, phobos d7e79f024.
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / bug8891.d
CommitLineData
b4c522fa
IB
1/*
2TEST_OUTPUT:
3---
d6679fa2 4fail_compilation/bug8891.d(21): Error: calling non-static function `opCall` requires an instance of type `S`
b4c522fa
IB
5---
6*/
7
8struct S
9{
10 int value = 10;
11 S opCall(int n) // non-static
12 {
13 //printf("this.value = %d\n", this.value); // prints garbage!
14 S s;
15 s.value = n;
16 return s;
17 }
18}
19void main()
20{
21 S s = 10;
22}