www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14429] New: Linker error caused by a combination of multiple


          Issue ID: 14429
           Summary: Linker error caused by a combination of multiple
                    factors (static library, inlining, lambda alias and
                    ref parameters)
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: link-failure
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: sludwig outerproduct.org

The conditions for triggering this look somewhat complex. The following targets
need to be compiled with -inline:

void foo(alias F = () => true)()

void bar()
    int _value;

void unescapeStringLiteral(alias F = () => true)(ref int)
    // force no-inline, using exceptions or asm { nop; } has the same effect
    static bool x;

import lib;

void main()

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
collect2: error: ld returned 1 exit status
--- errorlevel 1

Apr 09 2015