]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/fail_compilation/fail15.d
d: Synchronize testsuite with upstream dmd
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail15.d
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail15.d(24): Error: cannot use `[]` operator on expression of type `void`
5 ---
6 */
7 /*
8 Segfault on DMD 0.095
9 http://www.digitalmars.com/d/archives/digitalmars/D/bugs/926.html
10 */
11 module test;
12
13 template Test()
14 {
15 bool opIndex(bool x)
16 {
17 return !x;
18 }
19 }
20
21 void main()
22 {
23 mixin Test!() xs;
24 bool x = xs[false];
25 }
26
27