[Issue 22070] importC: Error: string literal is not an lvalue

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 26 09:30:59 UTC 2022


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

Steven Dwy <me at yoplitein.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |me at yoplitein.net
         Resolution|FIXED                       |---

--- Comment #5 from Steven Dwy <me at yoplitein.net> ---
This also applies to array literals, per 6.5.2.5-4:
> In either case [array or object], the result is an lvalue.
```
short(*v1)[2] = &(short[]){1, 2};
```

Object literals act as lvalues as expected.

Additionally, the following invalid code is now accepted:
```
char(**s1)[3] = &(&"aa");
char(***s2)[3] = &(&(&"aa"));
// and so on
```

--


More information about the Digitalmars-d-bugs mailing list