Bug 21196 – [REG 2.092] Deprecation for language feature triggered inside of deprecated block

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2020-08-25T08:18:14Z
Last change time
2020-09-11T06:12:24Z
Keywords
pull
Assigned to
No Owner
Creator
Mathias LANG

Comments

Comment #0 by pro.mathias.lang — 2020-08-25T08:18:14Z
``` deprecated void appendSlices ( Types ... ) ( ref void[][] slices, ref Types x ) { foreach (i, T; Types) { static if (is(T Element: Element[])) { static if (is(T == Element[])) { slices ~= (cast(void*)(&x[i]))[0 .. size_t.sizeof]; } // Append a slice to the array content. slices ~= x[i]; } else { slices ~= (cast(void*)(&x[i]))[0 .. x[i].sizeof]; } } } deprecated unittest { void[][] slices; char[] str = "Hello World!".dup; appendSlices(slices, str); } ``` Compiled with `dmd -unittest -main foo.d`: ``` Up to 2.062 : Failure with output: Error: unrecognized switch '-main' 2.063 to 2.089.1: Success and no output 2.090.1 to 2.091.1: Success with output: 1 unittests passed Since 2.092.1: Success with output: ----- onlineapp.d(9): Deprecation: copying `(cast(void*)&_param_1)[0..8]` into allocated memory escapes a reference to parameter variable `_param_1` 1 unittests passed ----- ```
Comment #1 by moonlightsentinel — 2020-08-25T17:57:23Z
digger: b65f7acf334495adf22397a5e306b2ea874190ed is the first bad commit commit b65f7acf334495adf22397a5e306b2ea874190ed Author: The Dlang Bot <[email protected]> Date: Wed Mar 4 04:41:39 2020 +0100 dmd: Merge pull request #10805 from Geod24/dip25 https://github.com/dlang/dmd/pull/10805 Enable DIP25 by default
Comment #2 by pro.mathias.lang — 2020-08-26T03:04:11Z
Oh, the irony.
Comment #3 by dlang-bot — 2020-08-26T03:22:06Z
@Geod24 created dlang/dmd pull request #11629 "Fix 21196 - Deprecation for DIP25 triggered in deprecated block" fixing this issue: - Fix 21196 - Deprecation for DIP25 triggered in deprecated block https://github.com/dlang/dmd/pull/11629
Comment #4 by dlang-bot — 2020-08-26T09:52:19Z
dlang/dmd pull request #11629 "Fix 21196 - Deprecation for DIP25 triggered in deprecated block" was merged into stable: - e32a51265a59c6968019de3ff4fae7f1e8847168 by Geod24: Fix 21196 - Deprecation for DIP25 triggered in deprecated block https://github.com/dlang/dmd/pull/11629
Comment #5 by dlang-bot — 2020-09-11T06:12:24Z
dlang/dmd pull request #11718 "merge stable" was merged into master: - 19c586ae424d507ad16cd79d2deb876a389446b8 by Geod24: Fix 21196 - Deprecation for DIP25 triggered in deprecated block https://github.com/dlang/dmd/pull/11718