]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gdc.test/fail_compilation/fail7851.d
d: Synchronize testsuite with upstream dmd
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail7851.d
CommitLineData
7da827c9
IB
1// https://issues.dlang.org/show_bug.cgi?id=7851
2/*
3TEST_OUTPUT:
4---
5fail_compilation/fail7851.d(38): Error: need `this` for `__mem_field_0` of type `int`
6fail_compilation/fail7851.d(38): Error: need `this` for `__mem_field_1` of type `long`
7fail_compilation/fail7851.d(38): Error: need `this` for `__mem_field_2` of type `float`
8---
9*/
b4c522fa
IB
10
11
12template TypeTuple(TList...)
13{
14 alias TList TypeTuple;
15}
16
17struct Tuple(Specs...)
18{
19 TypeTuple!(int, long, float) mem;
20
21 alias Identity!(mem[0]) _0;
22 alias Identity!(mem[1]) _1;
23 alias Identity!(mem[2]) _2;
24
25 alias mem this;
26
27 enum length = mem.length;
28}
29
30private template Identity(alias T)
31{
32 alias T Identity;
33}
34
35
36void main() {
37 alias Tuple!(int, long, float) TL;
38 foreach (i; TL)
39 { }
40}
41