[Issue 2196] New: Link errors with an abstract class's method implementing an interface

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jul 5 10:11:49 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2196

           Summary: Link errors with an abstract class's method implementing
                    an interface
           Product: D
           Version: 1.031
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: link-failure, spec
          Severity: minor
          Priority: P3
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: diggory.hardy at gmail.com


The following code generates an error at link time:

interface A
{
    void foo ();
}

abstract class B : A
{
    void foo ();
}

void main() {}


The error:
abstract.o: In function `_TMP0':
abstract.d:(.text+0x4): undefined reference to `_D8abstract1B3fooMFZv'
collect2: ld returned 1 exit status


Marking foo in B as abstract avoids the problem. The documentation isn't at all
clear on whether this should be the case.

Tried with dmd 1.031 and 1.027, and gcc (Debian 4.3.1-2) 4.3.1.


-- 



More information about the Digitalmars-d-bugs mailing list