http://d.puremagic.com/issues/show_bug.cgi?id=8863
Walter Bright <bugzi...@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugzi...@digitalmars.com --- Comment #2 from Walter Bright <bugzi...@digitalmars.com> 2012-11-13 23:37:24 PST --- D templates have an interesting feature where they can be "locally instantiated" if their arguments refer to local arguments. This is controlled by the "isnested" member in template.c, set by TemplateInstance::hasNestedArgs(). It should have the effect of moving the definition of fun() into main(), like this: -------------------------- void main() { auto fun(T)(T* ret) { *ret = T(); } struct A { auto f() {} } A a; fun!A(&a); } ----------------------- which compiles successfully. So I'd say it is a bug, and the fault is likely in TemplateInstance::hasNestedArgs(). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------