]> git.ipfire.org Git - people/ms/gcc.git/blob - gcc/testsuite/gdc.test/fail_compilation/ice18753.d
253025cdc7a3be754899d4705ac81a3105dd7639
[people/ms/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / ice18753.d
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/ice18753.d(21): Error: variable `ice18753.isInputRange!(Group).isInputRange` type `void` is inferred from initializer `ReturnType(func...)`, and variables cannot be of type `void`
5 fail_compilation/ice18753.d(23): Error: template instance `ice18753.isInputRange!(Group)` error instantiating
6 fail_compilation/ice18753.d(18): instantiated from here: `isForwardRange!(Group)`
7 fail_compilation/ice18753.d(18): while evaluating: `static assert(isForwardRange!(Group))`
8 ---
9 */
10
11 // https://issues.dlang.org/show_bug.cgi?id=18753
12
13 struct ChunkByImpl
14 {
15 struct Group
16 { }
17
18 static assert(isForwardRange!Group);
19 }
20
21 enum isInputRange(R) = ReturnType;
22
23 enum isForwardRange(R) = isInputRange!R is ReturnType!(() => r);
24
25 template ReturnType(func...)
26 {
27 static if (is(FunctionTypeOf!func R == return))
28 ReturnType R;
29 }
30
31 template FunctionTypeOf(func...)
32 {
33 static if (is(typeof(func[0]) T))
34 static if (is(T Fptr ) )
35 alias FunctionTypeOf = Fptr;
36 }
37
38 template Select()
39 { }