Bug 20705 – `-preview=rvaluerefparam` does not work with template deduction
Status
RESOLVED
Resolution
FIXED
Severity
blocker
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-03-29T10:15:13Z
Last change time
2021-04-09T10:48:54Z
Keywords
industry, pull
Assigned to
No Owner
Creator
Mathias LANG
Comments
Comment #0 by pro.mathias.lang — 2020-03-29T10:15:13Z
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)
```
Comment #1 by dlang-bot — 2021-03-29T08:14:31Z
@thewilsonator created dlang/dmd pull request #12318 "Fix issue 20705 - `-preview=rvaluerefparam` does not work with templa…" fixing this issue:
- Fix issue 20705 - `-preview=rvaluerefparam` does not work with template deduction
https://github.com/dlang/dmd/pull/12318
Comment #2 by dlang-bot — 2021-04-04T04:32:47Z
dlang/dmd pull request #12318 "Fix issue 20705 - `-preview=rvaluerefparam` does not work with templa…" was merged into stable:
- f398e297845deac6f7f8f06bdccebd21fd554736 by Nicholas Lindsay Wilson:
Fix issue 20705 - `-preview=rvaluerefparam` does not work with template deduction
https://github.com/dlang/dmd/pull/12318
Comment #3 by dlang-bot — 2021-04-09T10:48:54Z
dlang/dmd pull request #12408 "Merge stable into master" was merged into master:
- 128d40a86b9a408a8641ba1321b239db43ecc2e8 by Nicholas Lindsay Wilson:
Fix issue 20705 - `-preview=rvaluerefparam` does not work with template deduction
https://github.com/dlang/dmd/pull/12408