summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/test22023.d
blob: a0f553ba5bffbcd0aa90557e3864a024d55a5b34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* TEST_OUTPUT:
---
fail_compilation/test22023.d(102): Error: typesafe variadic function parameter `a` of type `int[]` cannot be marked `return`
fail_compilation/test22023.d(107): Error: typesafe variadic function parameter `c` of type `test22023.C` cannot be marked `return`
---
*/

// issues.dlang.org/show_bug.cgi?id=22023

#line 100

@safe:
ref int f(return int[] a ...)
{
    return a[2];
}

ref int g(return C c ...)
{
    return c.x;
}

class C
{
    int x;
}