mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-19 02:09:03 +02:00
Merged DMD 1.037 frontend
This commit is contained in:
24
dmd/func.c
24
dmd/func.c
@@ -1965,6 +1965,23 @@ int FuncDeclaration::isVirtual()
|
||||
toParent()->isClassDeclaration();
|
||||
}
|
||||
|
||||
int FuncDeclaration::isFinal()
|
||||
{
|
||||
ClassDeclaration *cd;
|
||||
#if 0
|
||||
printf("FuncDeclaration::isFinal(%s)\n", toChars());
|
||||
printf("%p %d %d %d %d\n", isMember(), isStatic(), protection == PROTprivate, isCtorDeclaration(), linkage != LINKd);
|
||||
printf("result is %d\n",
|
||||
isMember() &&
|
||||
!(isStatic() || protection == PROTprivate || protection == PROTpackage) &&
|
||||
(cd = toParent()->isClassDeclaration()) != NULL &&
|
||||
cd->storage_class & STCfinal);
|
||||
#endif
|
||||
return isMember() &&
|
||||
(Declaration::isFinal() ||
|
||||
((cd = toParent()->isClassDeclaration()) != NULL && cd->storage_class & STCfinal));
|
||||
}
|
||||
|
||||
int FuncDeclaration::isAbstract()
|
||||
{
|
||||
return storage_class & STCabstract;
|
||||
@@ -2708,10 +2725,11 @@ void UnitTestDeclaration::semantic(Scope *sc)
|
||||
{
|
||||
if (global.params.useUnitTests)
|
||||
{
|
||||
Type *tret;
|
||||
|
||||
type = new TypeFunction(NULL, Type::tvoid, FALSE, LINKd);
|
||||
FuncDeclaration::semantic(sc);
|
||||
Scope *sc2 = sc->push();
|
||||
sc2->linkage = LINKd;
|
||||
FuncDeclaration::semantic(sc2);
|
||||
sc2->pop();
|
||||
}
|
||||
|
||||
// We're going to need ModuleInfo even if the unit tests are not
|
||||
|
||||
Reference in New Issue
Block a user