Bug 12426 – Spurious "auto can only be used for template function parameters" for overloaded templated functions
Status
RESOLVED
Resolution
WORKSFORME
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-03-20T10:40:17Z
Last change time
2020-03-21T03:56:37Z
Keywords
diagnostic, rejects-valid
Assigned to
No Owner
Creator
Vladimir Panteleev
Comments
Comment #0 by dlang-bugzilla — 2014-03-20T10:40:17Z
///////// test.d ////////
void fun(T)(auto ref T t)
if (false)
{
}
void fun(T)()
{
}
alias fun!int funint;
/////////////////////////
Compiler complains:
test.d(1): Error: auto can only be used for template function parameters
Not only is this error spurious (the constraint will never pass), but the compiler does not indicate the location of the instantiation.