Bug 22706 – Bad error on explicit instantiation of function template with auto ref parameter

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-01-26T16:34:15Z
Last change time
2022-07-28T03:37:15Z
Keywords
diagnostic, pull
Assigned to
No Owner
Creator
Spoov
See also
https://issues.dlang.org/show_bug.cgi?id=8204

Comments

Comment #0 by spoov0.707 — 2022-01-26T16:34:15Z
### 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