[Issue 24238] Confusing "not an lvalue"error messages

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 10 14:43:13 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=24238

Dennis <dkorpel at live.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic

--- Comment #1 from Dennis <dkorpel at live.nl> ---
* Accidentally submitted to early *

See: https://forum.dlang.org/thread/ealqnukwfgosusrzzsbh@forum.dlang.org

```
void templateFunc(T)() {}

void addr()
{
    auto x0 = &templateFunc;
}
```

The error says "is not an lvalue and cannot be modified", but it should say
instead that it's a template, and you cannot take the address of it before
instantiating it.

--


More information about the Digitalmars-d-bugs mailing list