Bug 22654 – AST for UDA annotated struct with destructor does not run destructor

Status
NEW
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-01-07T04:15:12Z
Last change time
2024-12-13T19:20:16Z
Assigned to
No Owner
Creator
Nicholas Wilson
Moved to GitHub: dmd#20034 →

Comments

Comment #0 by iamthewilsonator — 2022-01-07T04:15:12Z
``` enum someUDA; struct S { ~this() { writeln("~S"); } } void main() { auto correct = S(); @someUDA auto bug = S(); } ``` with DMD prints ~S ~S as expected, but the AST verified with -vcg_ast lack an additional try block and destructor call for `bug` and LDC prints ~S as expected for the AST. DMD is doing something very strange here.
Comment #1 by robert.schadek — 2024-12-13T19:20:16Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20034 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB