[Issue 6600] New: unrelated expression alters function name mangling
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Sep 3 14:32:02 PDT 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 at puremagic.com
ReportedBy: dawg at dawgfoto.de
--- Comment #0 from dawg at 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: -------
More information about the Digitalmars-d-bugs
mailing list