digitalmars.D.bugs - [Issue 12211] New: Assignment expression is not an lvalue
- d-bugmail puremagic.com (24/24) Feb 19 2014 https://d.puremagic.com/issues/show_bug.cgi?id=12211
- d-bugmail puremagic.com (28/28) Feb 20 2014 https://d.puremagic.com/issues/show_bug.cgi?id=12211
- d-bugmail puremagic.com (26/26) Feb 20 2014 https://d.puremagic.com/issues/show_bug.cgi?id=12211
- d-bugmail puremagic.com (10/10) Feb 20 2014 https://d.puremagic.com/issues/show_bug.cgi?id=12211
- d-bugmail puremagic.com (11/11) Feb 22 2014 https://d.puremagic.com/issues/show_bug.cgi?id=12211
- d-bugmail puremagic.com (9/9) Feb 22 2014 https://d.puremagic.com/issues/show_bug.cgi?id=12211
https://d.puremagic.com/issues/show_bug.cgi?id=12211 Summary: Assignment expression is not an lvalue Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: k.hara.pg gmail.com Test case: void main() { int a; void foo(ref int x) { assert(&x == &a); } foo(a += 1); // OK //foo(a = 1); // doesn't compile } -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 19 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12211 In C++: #include <stdio.h> void foo(int& x) { printf("foo: x = %d\n", x); x = 3; } int main() { int a = 0; printf("a = %d\n", a); foo(a += 1); printf("a = %d\n", a); foo(a = 2); printf("a = %d\n", a); } Prints: --- a = 0 foo: x = 1 a = 3 foo: x = 2 a = 3 -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 20 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12211 Note that, "an assignment expression should make an lvalue" will be consistent with the behavior of the implicitly generated opAssign methods for user defined structs. import core.stdc.stdio; struct S { this(this) { printf("postblit\n"); } } void main() { S a; S b; pragma(msg, typeof(S.opAssign)); // Prints: pure nothrow ref safe S(S p) // So, the implicitly generated opAssign returns the reference of the // assigned value. b = (a = S()); // is translated to: b(a.opAssign(S())) // and the lvalue a.opAssign(S()) makes a copy. // Therefore, in runtime this line will print one "postblit". } -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 20 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12211 Kenji Hara <k.hara.pg gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |pull https://github.com/D-Programming-Language/dmd/pull/3306 -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 20 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12211 Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/34ce06a844fdb7e365469976ae010ee179c19e62 fix Issue 12211 - Assignment expression is not an lvalue https://github.com/D-Programming-Language/dmd/commit/7373fc1e4be70eb4003b3822cd1c39dcc7bb8223 Issue 12211 - Assignment expression is not an lvalue -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 22 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12211 Kenji Hara <k.hara.pg gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 22 2014