Bug 6411 – Undefined reference to __dgliteral in mixin

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2011-07-30T09:03:00Z
Last change time
2015-06-09T05:11:43Z
Keywords
link-failure
Assigned to
nobody
Creator
ibuclaw

Comments

Comment #0 by ibuclaw — 2011-07-30T09:03:33Z
The following code fails to link, but works just fine without 'mixin'. void main() { mixin({ string foo() { return ""; } string bar()() { return foo(); } return bar(); }()); } Linker error: bug.o: In function `_D3bug4mainFZv12__dgliteral1MFZAya8__T3barZ3barMFZAya': bug.d:(.text._D3bug4mainFZv12__dgliteral1MFZAya8__T3barZ3barMFZAya+0x7): undefined reference to `_D3bug4mainFZv12__dgliteral1MFZAya3fooMFZAya' collect2: ld returned 1 exit status --- errorlevel 1
Comment #1 by ibuclaw — 2014-01-14T02:08:12Z
Can no longer reproduce it using gdc... dunno if dmd is still not working.
Comment #2 by yebblies — 2014-01-15T01:00:07Z
dmd works.