Bug 14669 – auto attribute on function parameter should be error always
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-06-09T11:41:00Z
Last change time
2017-08-02T08:07:11Z
Keywords
accepts-invalid, pull
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2015-06-09T11:41:17Z
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`.