# HG changeset patch # User Christian Kamm # Date 1240333049 -7200 # Node ID 4b0b470bb2f94327328ffc5d94412a40769b16e4 # Parent 01909bd1132cf621bfa0783a5f5fb7f7485a97f2# Parent 871ae029ff49c3dddafa65a15d6b4e4d185b65e5 Automated merge with http://hg.dsource.org/projects/ldc diff -r 01909bd1132c -r 4b0b470bb2f9 gen/functions.cpp --- a/gen/functions.cpp Tue Apr 21 17:54:43 2009 +0200 +++ b/gen/functions.cpp Tue Apr 21 18:57:29 2009 +0200 @@ -386,8 +386,11 @@ Logger::println("DtoResolveFunction(%s): %s", fdecl->toPrettyChars(), fdecl->loc.toChars()); LOG_SCOPE; - // queue declaration unless the function is abstract without body - if (!fdecl->isAbstract() || fdecl->fbody) + // queue declaration unless the function is abstract without body; + // bodyless functions in an abstract class are considered abstract + ClassDeclaration* cd = fdecl->parent->isClassDeclaration(); + bool isabstract = fdecl->isAbstract() || (cd && cd->isAbstract()); + if (!isabstract || fdecl->fbody) { DtoDeclareFunction(fdecl); } diff -r 01909bd1132c -r 4b0b470bb2f9 ir/irclass.cpp --- a/ir/irclass.cpp Tue Apr 21 17:54:43 2009 +0200 +++ b/ir/irclass.cpp Tue Apr 21 18:57:29 2009 +0200 @@ -132,7 +132,7 @@ FuncDeclaration* fd = dsym->isFuncDeclaration(); assert(fd && "vtbl entry not a function"); - if (fd->isAbstract() && !fd->fbody) + if ((cd->isAbstract() || fd->isAbstract()) && !fd->fbody) { c = getNullValue(DtoType(fd->type->pointerTo())); } @@ -335,7 +335,7 @@ FuncDeclaration* fd = dsym->isFuncDeclaration(); assert(fd && "vtbl entry not a function"); - assert(!(fd->isAbstract() && !fd->fbody) && + assert(!((fd->isAbstract() || cd->isAbstract()) && !fd->fbody) && "null symbol in interface implementation vtable"); fd->codegen(Type::sir);