Bug 12425 – allow default values for "auto ref"

Status
RESOLVED
Resolution
WORKSFORME
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-03-20T09:29:40Z
Last change time
2020-03-21T03:56:35Z
Assigned to
No Owner
Creator
Vladimir Panteleev

Comments

Comment #0 by dlang-bugzilla — 2014-03-20T09:29:40Z
E.g.: void foo(T)(auto ref T t = 5) The parameter becomes a reference if the default expression is an lvalue (e.g. *new int(5)).
Comment #1 by bearophile_hugs — 2014-03-20T09:36:39Z
This was allowed, and it was "recently" disallowed.
Comment #2 by b2.temp — 2020-02-20T16:15:00Z
since 2.087.0