Bug 10055 – Incorrect attribute merging in dtor/postblit building

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-05-10T00:42:00Z
Last change time
2013-05-10T12:30:16Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2013-05-10T00:42:05Z
This is very similar to bug 10053. This code works with 2.062, but fails with git head. struct S1 { pure ~this() { } } struct S2 { ~this() { } } struct SX { S1 s1; S2 s2; } Output: Error: pure function 'test.SX.~this' cannot call impure function 'test.S2.~this'
Comment #1 by henning — 2013-05-10T06:28:28Z
Comment #2 by k.hara.pg — 2013-05-10T07:28:17Z
Although this is not a regression, same issue exists in implicit postblit generation. struct S1 { pure this(this) { } } struct S2 { pure this(this) { } } struct SX { S1 s1; S2 s2; } void main() pure { SX sx1; SX sx2 = sx1; // should succeed to compile, but doesn't }
Comment #3 by k.hara.pg — 2013-05-10T08:20:27Z
(In reply to comment #1) > https://github.com/D-Programming-Language/dmd/pull/2003 My fix, for both dtors and postblits. https://github.com/D-Programming-Language/dmd/pull/2006 I and Henning are discussing about compiler behavior in the pull request 2003.
Comment #4 by github-bugzilla — 2013-05-10T12:29:59Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/487b38293bee52927dd10ac4c6ab5e6d87428f78 fix Issue 10055 - Incorrect attribute merging in dtor/postblit building https://github.com/D-Programming-Language/dmd/commit/43650b955f35e0fe0aea92d95e3ae7c707796e23 Merge pull request #2006 from 9rnsr/fix10055 [REG2.063a] Issue 10055 - Incorrect attribute merging in dtor/postblit building