mirror of
https://github.com/dlang/dmd.git
synced 2025-04-27 05:30:13 +03:00
add __rvalue(expression) builtin (#17050)
This commit is contained in:
parent
13775eb2d1
commit
a99a3894be
31 changed files with 471 additions and 163 deletions
|
@ -1,20 +0,0 @@
|
|||
/*
|
||||
TEST_OUTPUT:
|
||||
---
|
||||
fail_compilation/fail19871.d(10): Error: `struct Struct` may not define both a rvalue constructor and a copy constructor
|
||||
fail_compilation/fail19871.d(19): rvalue constructor defined here
|
||||
fail_compilation/fail19871.d(13): copy constructor defined here
|
||||
---
|
||||
*/
|
||||
|
||||
struct Struct
|
||||
{
|
||||
@disable this();
|
||||
this(ref Struct other)
|
||||
{
|
||||
const Struct s = void;
|
||||
this(s);
|
||||
}
|
||||
|
||||
this(Struct) {}
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
/*
|
||||
TEST_OUTPUT:
|
||||
---
|
||||
fail_compilation/fail19931.d(10): Error: `struct S` may not define both a rvalue constructor and a copy constructor
|
||||
fail_compilation/fail19931.d(12): rvalue constructor defined here
|
||||
fail_compilation/fail19931.d(13): copy constructor defined here
|
||||
---
|
||||
*/
|
||||
|
||||
struct S
|
||||
{
|
||||
this(S s) {}
|
||||
this(ref S s) {}
|
||||
this(this) {}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
// https://issues.dlang.org/show_bug.cgi?id=23036
|
||||
|
||||
/*
|
||||
TEST_OUTPUT:
|
||||
---
|
||||
fail_compilation/fail23036.d(12): Error: `struct S` may not define both a rvalue constructor and a copy constructor
|
||||
fail_compilation/fail23036.d(15): rvalue constructor defined here
|
||||
fail_compilation/fail23036.d(14): copy constructor defined here
|
||||
---
|
||||
*/
|
||||
|
||||
struct S
|
||||
{
|
||||
this(ref S) {}
|
||||
this(S, int a = 2) {}
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
S a;
|
||||
S b = a;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue