]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gdc.test/fail_compilation/fail9936.d
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail9936.d
CommitLineData
b4c522fa
IB
1/*
2TEST_OUTPUT:
3---
5fee5ec3
IB
4fail_compilation/fail9936.d(25): Error: `S().opBinary` isn't a template
5fail_compilation/fail9936.d(26): Error: `S().opBinaryRight` isn't a template
6fail_compilation/fail9936.d(27): Error: `S().opOpAssign` isn't a template
7fail_compilation/fail9936.d(29): Error: `S().opIndexUnary` isn't a template
8fail_compilation/fail9936.d(30): Error: `S().opUnary` isn't a template
b4c522fa
IB
9---
10*/
11struct S
12{
13 auto opBinary(S s) { return 1; }
14 auto opBinaryRight(int n) { return 1; }
15 auto opOpAssign(S s) { return 1; }
16
17 auto opIndexUnary(S s) { return 1; }
18 auto opUnary(S s) { return 1; }
19}
20void main()
21{
22 static assert(!is(typeof( S() + S() )));
23 static assert(!is(typeof( 100 + S() )));
24 static assert(!is(typeof( S() += S() )));
25 S() + S();
26 100 + S();
27 S() += S();
28
29 +S()[0];
30 +S();
31}