]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/compilable/issue20705.d
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / compilable / issue20705.d
1 // REQUIRED_ARGS: -preview=rvaluerefparam
2 struct Foo
3 {
4 int[] a;
5 }
6
7 void bar (T) (const ref T arg) {}
8 T foo (T) (ref T arg) { return arg; }
9 void goo()(ref long x) { x = 1; }
10 void main ()
11 {
12 bar(Foo([42]));
13 auto x = foo(Foo([42]));
14 int y;
15 static assert(!__traits(compiles, goo(y)));
16 }