Bug 14429 – Linker error caused by a combination of multiple factors (static library, inlining, lambda alias and ref parameters)

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2015-04-09T08:46:10Z
Last change time
2024-12-13T18:42:04Z
Keywords
link-failure
Assigned to
No Owner
Creator
Sönke Ludwig
Moved to GitHub: dmd#18971 →

Comments

Comment #0 by sludwig — 2015-04-09T08:46:10Z
The conditions for triggering this look somewhat complex. The following targets need to be compiled with -inline: lib.d --- void foo(alias F = () => true)() { } void bar() { int _value; unescapeStringLiteral(_value); } void unescapeStringLiteral(alias F = () => true)(ref int) { // force no-inline, using exceptions or asm { nop; } has the same effect static bool x; } --- app.d --- import lib; void main() { foo(); bar(); } --- Building with: dmd -lib -inline -oflib.a lib.d dmd -inline app.d lib.a Results in: app.o: In Funktion `_Dmain': app.d:(.text._Dmain+0x12): Nicht definierter Verweis auf `_D3lib58__T21unescapeStringLiteralS28_D3lib9__lambda6MFNaNbNiNfZbZ21unescapeStringLiteralFNaNbNiNfKiZv' collect2: error: ld returned 1 exit status --- errorlevel 1
Comment #1 by robert.schadek — 2024-12-13T18:42:04Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18971 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB