Bug 12686 – Struct invariant prevents NRVO

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-04-30T16:27:00Z
Last change time
2014-05-06T20:54:26Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
bugzilla

Comments

Comment #0 by bugzilla — 2014-04-30T16:27:40Z
Test case: struct Foo { invariant() { } @disable this(this); Foo bar() { Foo f; return f; } } When presented with the above, DMD complains: bug.d(10): Error: struct bug.Foo is not copyable because it is annotated with @disable If the struct invariant is removed, the code compiles just fine.
Comment #1 by k.hara.pg — 2014-05-05T16:42:51Z
Comment #2 by github-bugzilla — 2014-05-06T20:54:26Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/5ccbb048d7da62d4bceea99ff85845da2b71daec fix Issue 12686 - Struct invariant prevents NRVO https://github.com/D-Programming-Language/dmd/commit/e5c8d6f1467ba834cb168fcab458527461fe6937 Merge pull request #3527 from 9rnsr/fix12686 Issue 12686 - Struct invariant prevents NRVO