www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15912] New: Anonymous class with missing method results in


          Issue ID: 15912
           Summary: Anonymous class with missing method results in linker
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: andy.pj.hanson gmail.com

This code successfully compiles, but fails to link:

    abstract class A {
        void x();

    void main() {
        new class A {};

The error is:

    app.o:(.data._D3app4mainFZ13__anonclass516__vtblZ+0x28): undefined
reference to `_D3app1A1xMFZv'

The error message doesn't mention what causes the error, so it would be nice to
detect these problems at compile-time.

This might be related to issue 13438.

Apr 10 2016