[Issue 20565] Local template function in static foreach yields link error LNK1179 on fresh compile

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jan 3 09:48:02 UTC 2021


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

Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|x86_64                      |All
                 OS|Windows                     |All

--- Comment #3 from Walter Bright <bugzilla at digitalmars.com> ---
A simpler demonstration of the problem:

  void main()
  {
    {
        int temp(T)() { return 3; }

        temp!int();
    }

    {
        int temp(T)() { return 4; }

        temp!int();
    }
  }

which affects all targets. Both functions are generated, the mangled names of
the two functions are the same, and on non-MSCOFF targets one of the two
functions is picked. Changing this to All platforms.

--


More information about the Digitalmars-d-bugs mailing list