add __rvalue(expression) builtin (#17050)

This commit is contained in:
Walter Bright 2024-12-15 12:13:28 -08:00 committed by GitHub
parent 13775eb2d1
commit a99a3894be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
31 changed files with 471 additions and 163 deletions

View file

@ -0,0 +1,22 @@
/* PERMUTE_ARGS: -preview=rvaluerefparam
*/
struct S
{
alias TT this;
long TT();
this(T)(int x) {} // works if `int` is `long`
this(S);
this(ref S);
~this();
}
S fun(ref S arg);
void test()
{
S st;
fun(st);
}