[Issue 20705] New: `-preview=rvaluerefparam` does not work with template deduction
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Mar 29 10:15:13 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=20705
Issue ID: 20705
Summary: `-preview=rvaluerefparam` does not work with template
deduction
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: industry
Severity: blocker
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: pro.mathias.lang at gmail.com
Marking as blocker because this is just bad:
```
struct Foo
{
int a;
}
void bar (T) (const ref T arg) {}
void main ()
{
bar(Foo(42));
}
```
DMD 2.091:
```
dmd -preview=rvaluerefparam autoref.d
autoref.d(10): Error: template autoref.bar cannot deduce function from argument
types !()(Foo), candidates are:
autoref.d(6): bar(T)(ref const T arg)
```
--
More information about the Digitalmars-d-bugs
mailing list