aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/test22541.d
blob: 910db0a955b9afe1c6c551daf3c7594d9fc2b215 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* REQUIRED_ARGS: -preview=dip1000
TEST_OUTPUT:
---
fail_compilation/test22541.d(104): Error: returning `i` escapes a reference to parameter `i`
fail_compilation/test22541.d(104):        perhaps annotate the parameter with `return`
---
 */

/* https://issues.dlang.org/show_bug.cgi?id=22541
 */

#line 100

@safe
ref int newe(ref return scope int i) // ref, error
{
    return i;
}