### test.d ###
void foo(T)(auto ref T arg) {}
alias bar = foo!int;
produces the error message:
test.d(1): Error: `auto` can only be used as part of `auto ref` for template function parameters
test.d(2): Error: template instance `test.foo!int` error instantiating
which makes not much sense.
The message should instead explain that it is not possible to decide if arg is passed by ref or not.
Comment #1 by dlang-bot — 2022-07-27T14:50:05Z
@ntrel created dlang/dmd pull request #14334 "Fix Issue 22706 - Bad error on explicit instantiation of function tem…" fixing this issue:
- Fix Issue 22706 - Bad error on explicit instantiation of function template with auto ref parameter
https://github.com/dlang/dmd/pull/14334
Comment #2 by dlang-bot — 2022-07-28T03:37:15Z
dlang/dmd pull request #14334 "Fix Issue 22706 - Bad error on explicit instantiation of function tem…" was merged into master:
- 8c45bea546b324010b0f9d2e4be1e9f76ef54c89 by Nick Treleaven:
Fix Issue 22706 - Bad error on explicit instantiation of function template with auto ref parameter
https://github.com/dlang/dmd/pull/14334