www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22750] New: dmd -i: undefined symbol error using templates


          Issue ID: 22750
           Summary: dmd -i: undefined symbol error using templates defined
                    in .di file
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: duser airmail.cc

// dimodule.di
void fn()() { return; }

// main.d
import dimodule;
void main() { fn(); }

this works with "dmd main.d", but "dmd -i main.d" gives an undefined symbol
error for the template function

tested with versions: dmd v2.098.1 and current git master (commit

the importC builtin functions in __builtins.di can't be used with dmd -i
because of this:

// main.c
// undefined symbol error with "dmd -i main.c" but works with "dmd main.c"
int main() { double x = __builtin_inf(); }

Feb 08 2022