www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14043] New: Undefined reference error when compiling some


          Issue ID: 14043
           Summary: Undefined reference error when compiling some
                    functions with -inline
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: GenericNPC gmail.com

When I try to call to std.stdio.File.rawRead with anything other than ubyte[]
and compile with -inline, dmd complains about undefined reference to

$ cat example.d
import std.stdio;
void main() {
    byte[] buffer;
    File file;
$ dmd -inline example.d
example.o: In function `_D3std5stdio4File14__T7rawReadTgZ7rawReadMFAgZAg':
undefined reference to
collect2: error: ld returned 1 exit status
--- errorlevel 1

Note that this only happens when I use the -inline flag and when the argument
to rawRead is *not* ubyte[]. I don't think the problem is in Phobos, but in dmd
that cannot instantiate templates when inlining templated functions.

I've experienced this problem on dmd 2.066 and 2.066.1

Jan 25 2015