]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/fail_compilation/fail11720.d
Add D front-end, libphobos library, and D2 testsuite.
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail11720.d
1 // REQUIRED_ARGS: -o-
2 /*
3 TEST_OUTPUT:
4 ---
5 fail_compilation/fail11720.d(23): Error: declaration fail11720.foo!().foo.temp is already defined in another scope in foo
6 fail_compilation/fail11720.d(13): Error: template instance fail11720.foo!() error instantiating
7 fail_compilation/fail11720.d(31): Error: declaration fail11720.bar.temp is already defined in another scope in bar
8 ---
9 */
10
11 void main()
12 {
13 foo();
14 bar();
15 }
16
17 alias TypeTuple(T...) = T;
18
19 void foo()()
20 {
21 foreach (T; TypeTuple!(int, double))
22 {
23 static temp = T.stringof;
24 }
25 }
26
27 void bar()
28 {
29 foreach (T; TypeTuple!(int, double))
30 {
31 static temp = T.stringof;
32 }
33 }