mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-03 16:41:06 +03:00
Revert change to treat bodyless functions in abstract classes as abstract.
See DMD bug 2894.
This commit is contained in:
parent
83dda319ae
commit
8916f783b7
2 changed files with 4 additions and 7 deletions
|
@ -386,11 +386,8 @@ void DtoResolveFunction(FuncDeclaration* fdecl)
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -132,7 +132,7 @@ LLConstant * IrStruct::getVtblInit()
|
|||
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 @@ llvm::GlobalVariable * IrStruct::getInterfaceVtbl(BaseClass * b, bool new_instan
|
|||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue