Bug 5810 – Struct postincrement generates 'no effect' error if used on struct member
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-04-03T16:33:00Z
Last change time
2014-06-09T04:27:45Z
Keywords
diagnostic, pull, rejects-valid
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2011-04-03T16:33:07Z
import std.bigint;
struct Foo {
BigInt x;
void bar() { x++; }
}
void main() {}
DMD 2.052 shows:
test.d(4): Error: var has no effect in expression (__tmp19)
Comment #1 by clugdbug — 2011-05-06T04:17:21Z
It's nothing to do with BigInt. Here's a reduced test case:
struct Bug5810 {
void opUnary(string op)() { }
}
struct Foo {
Bug5810 x;
void bar() { x++; }
}
test2.d(13): Error: var has no effect in expression (__pitmp4)