Bug 11271 – [REG 2.063] auto ref opAssign + destructor + struct literal fails

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-15T02:36:00Z
Last change time
2013-10-15T11:40:03Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2013-10-15T02:36:15Z
The following code used to work fine up to dmd 2.062. Error message of dmd 2.063.2 and dmd 2.064 beta 1: repro.d(16): Error: template repro.SmartPtr!(Object).SmartPtr.opAssign(U)(auto ref U rh) cannot deduce template function from argument types !()(SmartPtr!(Object)) Error message of dmd 2.064 git head: repro.d(16): Error: template repro.SmartPtr!(Object).SmartPtr.opAssign does not match any function template declaration. Candidates are: repro.d(8): repro.SmartPtr!(Object).SmartPtr.opAssign(U)(auto ref U rh) repro.d(16): Error: template repro.SmartPtr!(Object).SmartPtr.opAssign(U)(auto ref U rh) cannot deduce template function from argument types !()(SmartPtr!(Object)) Repro case: struct SmartPtr(T) { ~this() { } // BUG: adding "auto ref" to U will fail compilation void opAssign(U)(auto ref U rh) { } } void main(string[] args) { SmartPtr!Object a; a = SmartPtr!Object(); }
Comment #1 by k.hara.pg — 2013-10-15T06:46:46Z
Comment #2 by github-bugzilla — 2013-10-15T11:05:47Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/5147c8a1f28053429378e016bed6b5e9bbe9c7e4 fix Issue 11271 - auto ref opAssign + destructor + struct literal fails https://github.com/D-Programming-Language/dmd/commit/f2a0a8a4699585c484ef5f5afb1553ae4a1562cf Merge pull request #2669 from 9rnsr/fix11271 [REG 2.063] Issue 11271 - auto ref opAssign + destructor + struct literal fails
Comment #3 by github-bugzilla — 2013-10-15T11:39:32Z
Commit pushed to 2.064 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/c6edebb4138f2f3b9017183b6780b124489ecc1f Merge pull request #2669 from 9rnsr/fix11271 [REG 2.063] Issue 11271 - auto ref opAssign + destructor + struct literal fails