[Issue 22706] New: Bad error message when trying to explicitly instantiate a function template with an auto ref parameter
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Jan 26 16:34:15 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=22706
Issue ID: 22706
Summary: Bad error message when trying to explicitly
instantiate a function template with an auto ref
parameter
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: minor
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: spoov0.707 at gmail.com
### 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.
--
More information about the Digitalmars-d-bugs
mailing list