http://d.puremagic.com/issues/show_bug.cgi?id=11271
Summary: [REG 2.063] auto ref opAssign + destructor + struct
literal fails
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Keywords: rejects-valid
Severity: regression
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Benjamin Thaut <[email protected]> 2013-10-15 02:36:15
PDT ---
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();
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------