http://d.puremagic.com/issues/show_bug.cgi?id=6705
Summary: Bad codegen when passing fields as template alias
params
Product: D
Version: D2
Platform: x86
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Vladimir Panteleev <[email protected]> 2011-09-21
02:22:48 PDT ---
I'm not sure if this is valid code, so it's either accepts-invalid or
wrong-code.
I was trying to implement member field pointers, when I ran into this:
int func(alias F)(int i)
{
return i;
}
class C
{
int a;
}
void main()
{
auto a = &func!(C.a);
assert(a(5) == 5);
//auto i = func!(C.a)(5); // uncomment for a weird compiler error
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------