# HG changeset patch # User Christian Kamm # Date 1240643492 -7200 # Node ID 854e86eaa02299c2f9f7d454d4c206882482aa2b # Parent 3d6a908a34e94a187cf0fb0115c5990c7887c0c2 Revert change to treat bodyless functions in abstract classes as abstract. See DMD bug 2894. diff -r 3d6a908a34e9 -r 854e86eaa022 gen/functions.cpp --- a/gen/functions.cpp Fri Apr 24 16:47:42 2009 +0200 +++ b/gen/functions.cpp Sat Apr 25 09:11:32 2009 +0200 @@ -386,11 +386,8 @@ Logger::println("DtoResolveFunction(%s): %s", fdecl->toPrettyChars(), fdecl->loc.toChars()); LOG_SCOPE; - // queue declaration unless the function is abstract without body; - // bodyless functions in an abstract class are considered abstract - ClassDeclaration* cd = fdecl->isMember() ? fdecl->isMember()->isClassDeclaration() : NULL; - bool isabstract = fdecl->isAbstract() || (cd && cd->isAbstract()); - if (!isabstract || fdecl->fbody) + // queue declaration unless the function is abstract without body + if (!fdecl->isAbstract() || fdecl->fbody) { DtoDeclareFunction(fdecl); } diff -r 3d6a908a34e9 -r 854e86eaa022 ir/irclass.cpp --- a/ir/irclass.cpp Fri Apr 24 16:47:42 2009 +0200 +++ b/ir/irclass.cpp Sat Apr 25 09:11:32 2009 +0200 @@ -132,7 +132,7 @@ FuncDeclaration* fd = dsym->isFuncDeclaration(); assert(fd && "vtbl entry not a function"); - if ((cd->isAbstract() || fd->isAbstract()) && !fd->fbody) + if (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() || cd->isAbstract()) && !fd->fbody) && + assert((!fd->isAbstract() || fd->fbody) && "null symbol in interface implementation vtable"); fd->codegen(Type::sir);