]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/fail_compilation/fail162.d
Add D front-end, libphobos library, and D2 testsuite.
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail162.d
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail162.d(25): Error: template fail162.testHelper cannot deduce function from argument types !()(string, string), candidates are:
5 fail_compilation/fail162.d(10): fail162.testHelper(A...)()
6 fail_compilation/fail162.d(30): Error: template instance fail162.test!("hello", "world") error instantiating
7 ---
8 */
9
10 template testHelper(A ...)
11 {
12 char[] testHelper()
13 {
14 char[] result;
15 foreach (t; a)
16 {
17 result ~= "int " ~ t ~ ";\r\n";
18 }
19 return result;
20 }
21 }
22
23 template test(A...)
24 {
25 const char[] test = testHelper(A);
26 }
27
28 int main(char[][] args)
29 {
30 mixin(test!("hello", "world"));
31 return 0;
32 }