digitalmars.D.bugs - [Issue 8599] New: Link time error when class's method are defined without body and nothing is abstract
- d-bugmail puremagic.com (26/26) Aug 29 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8599
- d-bugmail puremagic.com (19/19) Aug 29 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8599
- d-bugmail puremagic.com (7/17) Sep 02 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8599
http://d.puremagic.com/issues/show_bug.cgi?id=8599 Summary: Link time error when class's method are defined without body and nothing is abstract Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: deadalnix gmail.com The sample code is the simplest ever : class A { void foo(); } This will cause the error : classfail.o:(.rodata+0x50): undefined reference to `_D9classfail1A3fooMFZv' when compiling with dmd 2.060 declaring A or foo as abstract fix the problem. abstract should be deducted from code or compilation should fail before linking stage. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Aug 29 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8599 Jonathan M Davis <jmdavisProg gmx.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |jmdavisProg gmx.com Resolution| |INVALID PDT --- abstract is never inferred. Why would it be inferred? Functions are only abstract if marked abstract. And if a function is not abstract, then it needs a body/definition, so obviousy it's going to fail at link time when the linker doesn't find a definition for it. It's perfectly legal to declare a function without giving its body as long as the linker has the body. That's how .di files work. It's also useful with stuff like version(D_Ddoc) where there is no definition and shouldn't be one. This isn't a bug. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Aug 29 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8599abstract is never inferred. Why would it be inferred? Functions are only abstract if marked abstract. And if a function is not abstract, then it needs a body/definition, so obviousy it's going to fail at link time when the linker doesn't find a definition for it. It's perfectly legal to declare a function without giving its body as long as the linker has the body. That's how .di files work. It's also useful with stuff like version(D_Ddoc) where there is no definition and shouldn't be one. This isn't a bug.You are right. I'm so dumb sometime. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 02 2012