mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-26 16:43:13 +01:00
Do not emit declare or emit a vtbl entry for bodyless functions in abstract classes.
Maybe the better fix would be to adjust FuncDeclaration::isAbstract, but there may be unwelcome sideeffects.
This commit is contained in:
@@ -361,8 +361,11 @@ 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
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user