www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19154] New: Undefined reference to inline function in mixin


          Issue ID: 19154
           Summary: Undefined reference to inline function in mixin
           Product: D
           Version: D2
          Hardware: x86_64
               URL: https://forum.dlang.org/post/eaaquwgqoapxuaxkdvfg foru
                OS: Linux
            Status: NEW
          Keywords: link-failure
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: dfj1esp02 sneakemail.com

mixin template test()
        pragma(inline, true) // remove this will work
        static int zzz()
                return 0;
        int dummy = zzz();

void f()
        mixin test!();

Trying to link this code gives
error: undefined reference to '_D9onlineapp1fFZ8__mixin13zzzFNbNiZi'
collect2: error: ld returned 1 exit status
Error: linker exited with status 1

Aug 10 2018