[Issue 19154] New: Undefined reference to inline function in mixin template

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Aug 10 14:06:27 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=19154

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

--


More information about the Digitalmars-d-bugs mailing list