Mercurial > projects > ldc
comparison gen/functions.cpp @ 1249:871ae029ff49
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.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sun, 19 Apr 2009 00:06:23 +0200 |
parents | 1e699a4e9759 |
children | 4b0b470bb2f9 |
comparison
equal
deleted
inserted
replaced
1247:2a92c115461d | 1249:871ae029ff49 |
---|---|
359 fdecl->ir.resolved = true; | 359 fdecl->ir.resolved = true; |
360 | 360 |
361 Logger::println("DtoResolveFunction(%s): %s", fdecl->toPrettyChars(), fdecl->loc.toChars()); | 361 Logger::println("DtoResolveFunction(%s): %s", fdecl->toPrettyChars(), fdecl->loc.toChars()); |
362 LOG_SCOPE; | 362 LOG_SCOPE; |
363 | 363 |
364 // queue declaration unless the function is abstract without body | 364 // queue declaration unless the function is abstract without body; |
365 if (!fdecl->isAbstract() || fdecl->fbody) | 365 // bodyless functions in an abstract class are considered abstract |
366 ClassDeclaration* cd = fdecl->parent->isClassDeclaration(); | |
367 bool isabstract = fdecl->isAbstract() || (cd && cd->isAbstract()); | |
368 if (!isabstract || fdecl->fbody) | |
366 { | 369 { |
367 DtoDeclareFunction(fdecl); | 370 DtoDeclareFunction(fdecl); |
368 } | 371 } |
369 } | 372 } |
370 | 373 |