D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 9377 - Link-failure regression cause by fixing issue 8504
Summary: Link-failure regression cause by fixing issue 8504
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 regression
Assignee: No Owner
URL:
Keywords: link-failure, pull
Depends on:
Blocks:
 
Reported: 2013-01-23 01:29 UTC by Kenji Hara
Modified: 2013-01-24 15:33 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Kenji Hara 2013-01-23 01:29:53 UTC
From: https://github.com/D-Programming-Language/dmd/pull/1096#issuecomment-12584452

----
This pull breaks the following test case:

C:\cbx\mars\test>..\dmd -m32 -c mula mulb -lib
DMD v2.062 DEBUG

C:\cbx\mars\test>..\dmd -m32 multi mula.lib
DMD v2.062 DEBUG
OPTLINK (R) for Win32  Release 8.00.12
Copyright (C) Digital Mars 1989-2010  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
multi.obj(multi)
 Error 42: Symbol Undefined _D4mulb8__T3defZ3memFZv

mula.d:

import std.c.stdio;

import mulb;

void abc()
{
    printf("mulb.abc()\n");
    foo();
    bar();
}

mulb.d:

module mulb;

import std.c.stdio;

int j;

int foo()()
{
    printf("foo()\n");
    static int z = 7;
    assert(z != 10);
    return ++z;
}

void bar()
{
    assert(j == 7);
    foo();
    printf("bar\n");
}

template def()
{
    alias int defint;

    static this()
    {
        printf("def.static this()\n");
        j = 7;
    }

    void mem()
    {
        printf("def().mem()\n");
    }
}

def!().defint x;

multi.d:

import std.c.stdio;

import mula, mulb;

int main()
{
    printf("main\n");
    abc();
    def!().mem();
    return 0;
}
Comment 2 github-bugzilla 2013-01-24 14:27:43 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/6a0be5b98961a773c7380ac45f14f1a8a76349b9
fix Issue 9377 - Link-failure regression cause by fixing issue 8504

The test is disabled only in win64 platform.

https://github.com/D-Programming-Language/dmd/commit/de4f8f6bf8dc9fcc1730ea4d7f2bbd3e74880f08
Merge pull request #1543 from 9rnsr/fix5933

Issue 5933 & 7159 & 9377 - Invoke function semantic3 correctly where it is required.