Mercurial > projects > ldc
changeset 1261:854e86eaa022
Revert change to treat bodyless functions in abstract classes as abstract.
See DMD bug 2894.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sat, 25 Apr 2009 09:11:32 +0200 |
parents | 3d6a908a34e9 |
children | 4fc43e173a0f |
files | gen/functions.cpp ir/irclass.cpp |
diffstat | 2 files changed, 4 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- 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); }
--- 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);