Bug 24378 – [REG 2.104] inout error with -profile=gc

Status
NEW
Severity
regression
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2024-02-08T22:10:50Z
Last change time
2024-12-07T13:43:13Z
Assigned to
No Owner
Creator
Tim
Moved to GitHub: dmd#17473 →

Comments

Comment #0 by tim.dlang — 2024-02-08T22:10:50Z
``` inout(char)[] foo(inout(char)[] s) pure @safe { s = s[0..1] ~ '%'; return s; } ``` The above code compiled with and without -profile=gc until DMD version 2.103. Since DMD 2.104 it only compiles without -profile=gc and produces the following error with -profile=gc: /path/to/dmd.linux/dmd2/linux/bin64/../../src/druntime/import/core/lifetime.d(1573): Error: `inout` on `return` means `inout` must be on a parameter as well for `pure nothrow @nogc @property @safe inout(char)[]()` /path/to/dmd.linux/dmd2/linux/bin64/../../src/druntime/import/core/internal/array/concatenation.d(174): Error: template instance `core.internal.array.concatenation._d_arraycatnTXTrace!(inout(char)[], inout(char)[], inout(char))._d_arraycatnTXTrace.forward!(__param_3, __param_4)` error instantiating onlineapp.d(3): instantiated from here: `_d_arraycatnTXTrace!(inout(char)[], inout(char)[], inout(char))` As a result of this issue, compiling DMD itself with -profile=gc does not work any more.
Comment #1 by tim.dlang — 2024-02-09T17:13:06Z
It seems to fail since this PR: https://github.com/dlang/dmd/pull/14550
Comment #2 by robert.schadek — 2024-12-07T13:43:13Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17473 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB