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


s...@iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |s...@iname.com
           Keywords|wrong-code                  |link-failure, spec




------- Comment #1 from s...@iname.com  2009-04-25 08:36 -------
That the first example links is understandable - because C.foo is never used,
the compiler doesn't create any references to it.

That the second example fails is semi-understandable - presumably the compiler
creates a vtbl for C's implementation of I, but the linker cannot resolve it
because no implementation of C.foo() has been linked in.  However, it does seem
that DMD could be better at DCE.

Less understandable is that this fails with the same error:
----------
abstract class C { void foo(); }
class D : C {}
void main() { }
----------

It was my understanding as well that a function in an abstract class is
automatically abstract if no body is given.  But it appears now that it's the
same as in a non-abstract - if the function isn't declared abstract, it
references an externally-defined function.  Still, the spec probably needs to
be clearer on the issue.


-- 

Reply via email to