https://issues.dlang.org/show_bug.cgi?id=14669
Issue ID: 14669
Summary: auto attribute on function parameter should be error
always
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: accepts-invalid
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
Test case:
void foo1()(auto int a) {} // line 1
void foo2()(auto int a) {}
void main()
{
alias f1 = foo1!(); // line 6
foo2(1); // no error!?
}
Output:
test.d(1): Error: auto can only be used for template function parameters
test.d(6): Error: template instance test.foo1!() error instantiating
The explicit instantiation foo1!() correctly rejects the invalid function
parameter `auto int a`, but the second IFTI call foo2(1) does not report same
error.
This is not related to `auto ref`.
--