Bug 1181 – DMD requires initializer for struct that shouldn't need one

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2007-04-23T13:56:15Z
Last change time
2019-05-21T00:48:00Z
Keywords
link-failure
Assigned to
No Owner
Creator
Sean Kelly

Comments

Comment #0 by sean — 2007-04-23T13:56:15Z
The presence of the "= void" in Wrap below should obviate the need for an initializer. C:\code\src\d\bugs>cat hdr.d struct Data { double val; } struct Wrap { Data data = void; } C:\code\src\d\bugs>cat app.d import hdr; void main() { Wrap w; } C:\code\src\d\bugs>dmd app c:\bin\dmd\bin\..\..\dm\bin\link.exe app,,,user32+kernel32/noi+tango.lib; OPTLINK (R) for Win32 Release 7.50B1 Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved app.obj(app) Error 42: Symbol Undefined _D3hdr4Wrap6__initZ --- errorlevel 1 C:\code\src\d\bugs>
Comment #1 by thomas-dloop — 2007-04-27T12:37:00Z
If optimization is enabled ("-O") the above code can be linked.
Comment #2 by andrej.mitrovich — 2013-01-22T11:17:16Z
This is also a D2 bug.
Comment #3 by pro.mathias.lang — 2019-05-21T00:48:00Z
Works in D2 now