]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gdc.test/fail_compilation/ice12902.d
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / ice12902.d
CommitLineData
b4c522fa
IB
1/*
2TEST_OUTPUT:
3---
5fee5ec3
IB
4fail_compilation/ice12902.d(20): Error: variable `ice12902.main.__dollar` type `void` is inferred from initializer `s.opDollar()`, and variables cannot be of type `void`
5fail_compilation/ice12902.d(20): Error: expression `s.opDollar()` is `void` and has no value
b4c522fa
IB
6---
7*/
8
9struct S
10{
11 void opDollar() { }
12 void opIndex() { }
13 void opIndexAssign() { }
14 void opSliceAssign() { }
15}
16
17void main()
18{
19 S s;
20 s[] = s[$];
21}