Thread overview
[Issue 6600] New: unrelated expression alters function name mangling
Sep 03, 2011
dawg@dawgfoto.de
Nov 14, 2011
dawg@dawgfoto.de
Nov 14, 2011
Kenji Hara
Jan 17, 2013
Martin Nowak
September 03, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6600

           Summary: unrelated expression alters function name mangling
           Product: D
           Version: D2
          Platform: Other
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: dawg@dawgfoto.de


--- Comment #0 from dawg@dawgfoto.de 2011-09-03 14:31:52 PDT ---
void funOneArg()() {}
void func_pure_nothrow() pure nothrow {}

void foo()
{
    // commenting the next line in/out will change the mangling of *f2
    // enum f1 = &curry!funOneArg;
    enum f2 = &func_pure_nothrow;
    pragma(msg, typeof(*f2));
    pragma(msg, typeof(*f2).mangleof);
}

auto curry(alias fun, Args...)(Args args)
{
    return fun(args);
}


---

Roughly the issue is that the deco member for TypeFunction isn't updated
when purityLevel is deduced lazily.
In detail:
TypePointer for f1 and f2 are merged as their types are already equal when
evaluating the AddrExp.
Now both TypePointer alias the same TypeFunction but that was created from a
function without 'pure nothrow'. That's why the deco buffer does still contain
unattributed function.

There is also the side issue that f2's TypeFunction suddenly has an empty tuple parameter.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 14, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6600



--- Comment #1 from dawg@dawgfoto.de 2011-11-13 17:38:11 PST ---
related:
http://d.puremagic.com/issues/show_bug.cgi?id=3796

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 14, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6600



--- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> 2011-11-13 17:53:02 PST ---
This issue seems to me that is same as bug 6902.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 17, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=6600


Martin Nowak <code@dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


--- Comment #3 from Martin Nowak <code@dawg.eu> 2013-01-16 21:26:47 PST ---
*** This issue has been marked as a duplicate of issue 6902 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------