Skip to content

Commit 1e2c7ee

Browse files
committed
Translate operator = to opAssign
1 parent 036d3ae commit 1e2c7ee

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/cppconv/dwriter.d

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6749,6 +6749,11 @@ void declarationToDCode(ref CodeWriter code, DWriterData data, Declaration d, im
67496749
operatorFunctionName = "opBinary(string op)";
67506750
operatorTemplateConstraint = " if (op == \"" ~ op ~ "\")";
67516751
}
6752+
if (op == "="
6753+
&& functionType.parameters.length == 1 && parentClassTree.isValid)
6754+
{
6755+
operatorFunctionName = "opAssign";
6756+
}
67526757
if (op.among("&=", "|=", "+=", "-=")
67536758
&& functionType.parameters.length == 1 && parentClassTree.isValid)
67546759
{

tests/single/test282.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ public:
3434
private:
3535
/+ Q_DISABLE_COPY_MOVE(C) +/
3636
@disable this(this);
37-
/+@disable this(ref const(C));+//+@disable ref C operator =(ref const(C));+/}
37+
/+@disable this(ref const(C));+/@disable ref C opAssign(ref const(C));}
3838

0 commit comments

Comments
 (0)