mirror of
https://github.com/dlang/dmd.git
synced 2025-04-27 05:30:13 +03:00
Move dmd files into compiler/
This commit is contained in:
parent
20bd0cacbd
commit
6374bb87b7
4579 changed files with 4 additions and 4 deletions
30
compiler/test/compilable/readmodify_structclass.d
Normal file
30
compiler/test/compilable/readmodify_structclass.d
Normal file
|
@ -0,0 +1,30 @@
|
|||
// REQUIRED_ARGS:
|
||||
shared struct S
|
||||
{
|
||||
int x = 0;
|
||||
|
||||
int opUnary(string s)() if (s == "++")
|
||||
{
|
||||
import core.atomic : atomicOp;
|
||||
return atomicOp!"+="(x, 1);
|
||||
}
|
||||
}
|
||||
|
||||
shared class C
|
||||
{
|
||||
int x = 0;
|
||||
|
||||
int opUnary(string s)() if (s == "++")
|
||||
{
|
||||
import core.atomic : atomicOp;
|
||||
return atomicOp!"+="(x, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
S s;
|
||||
s++;
|
||||
shared(C) c = new C();
|
||||
c++;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue