Summary: (Regression git) Methods defined in external object
                    files when template alias parameter is involved
           Product: D
           Version: D1
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: pull, wrong-code
          Severity: regression
          Priority: P2
         Component: DMD
        Depends on: 8016

--- Comment #0 from Leandro Lucarella <> 
2012-05-03 03:31:28 PDT ---
+++ This issue was initially created as a clone of Issue #8016 +++

This looks like a reincarnation of bug 7745, but is different.


module m1;

import m2;

private void t(alias Code)()
    return Code();

void f()
    t!( () { } )();

module m2;
import m1;

dmd -c -inline -release -g m2.d && nm m2.o | grep '_D2m11fFZv$'
00000000 T _D2m11fFZv

Which means that _D2m11fFZv (AKA m1.f()) is included in the text
(code) section of m2.o, but it shouldn't, it should only be in m1.d (which I
didn't even compile), otherwise when linking both m1.o and m2.o you'll get a
"multiple definition" error. Symbol _D2m11fFZv should be not present at all in
that object file.

Please note that the compiler flags -inline -release has to be used to
reproduce the bug, removing either makes it go away. -O is irrelevant.
Confirmed in both 32 and 64 bits.

This regression was introduced by commit "fix Issue 2962 - ICE(glue.c) or bad
codegen passing variable as template value parameter":

This pull request (for D2, expect a small conflict when merging), fixes the

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to