Bug 15632 – Calling delete on scope class should be an error?

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-01-31T15:11:36Z
Last change time
2022-05-30T16:58:02Z
Assigned to
No Owner
Creator
Iain Buclaw

Comments

Comment #0 by ibuclaw — 2016-01-31T15:11:36Z
Example: --- void f() { scope A a = new A(); delete a; } --- Produces the following codegen, which is not entirely desirable. --- void f() { A a = A.init; __ctor (&a); _d_callfinalizer (a); _d_callfinalizer (a); // Call always inserted by the compiler. } --- See here for when it came up. https://github.com/D-Programming-Language/dmd/pull/4860/files#diff-59055e7d57cf8be77c7e30104955e8fdL640
Comment #1 by nick — 2022-05-30T13:36:32Z
Presumably this can be closed now `delete` is gone: Error: the `delete` keyword is obsolete
Comment #2 by ibuclaw — 2022-05-30T16:58:02Z
Yes.