www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15021] New: [Reg 2.068.1] linker error with speculative

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

          Issue ID: 15021
           Summary: [Reg 2.068.1] linker error with speculative
                    instantiation and -inline
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: code dawg.eu

cat > bug.d << CODE
import std.conv;

class AliasDeclaration
{
}

void aliasDeclaration(AliasDeclaration ad)
{
    // This is extracted from VariantN
    AliasDeclaration* zis;
    static if (is(typeof(to!string(*zis))))
        to!string(*zis);
}

void main()
{
}
CODE

dmd -inline bug
----
bug.o:bug.d:function _D3bug16aliasDeclarationFC3bug16AliasDeclarationZv: error:
undefined reference to
'_D3std6format54__T22enforceValidFormatSpecTC3bug16AliasDeclarationTaZ22enforceValidFormatSpecFNaNfKS3std6format18__T10FormatSpecTaZ10FormatSpecZv'
bug.o:bug.d:function
_D3std4conv11__T2toTAyaZ31__T2toTC3bug16AliasDeclarationZ2toFC3bug16AliasDeclarationZAya:
error: undefined reference to
'_D3std6format54__T22enforceValidFormatSpecTC3bug16AliasDeclarationTaZ22enforceValidFormatSpecFNaNfKS3std6format18__T10FormatSpecTaZ10FormatSpecZv
----

This is most likely caused by
https://github.com/D-Programming-Language/dmd/pull/4944 and broke any code
using classes in Variant and specifically dfmt.

--
Sep 07 2015