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`.
Comment #1 by k.hara.pg — 2015-06-09T11:57:00Z
Comment #2 by github-bugzilla — 2015-08-31T13:48:23Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/dc044fe1fd55ff486002d39beaa80aa1c9df00a4 fix Issue 14669 - auto attribute on function parameter should be error always https://github.com/D-Programming-Language/dmd/commit/2ba1045c54521ee11d7ac315f71d346add93559f Merge pull request #4729 from 9rnsr/fix14669 Issue 14669 - auto attribute on function parameter should be error always
Comment #3 by github-bugzilla — 2017-08-02T08:07:11Z
Commit pushed to dmd-cxx at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/366c8e9171b18d892a69d961ca4d8655ba28d1cf Issue 14669 - auto attribute on function parameter should be error always