Mercurial > projects > ldc
comparison dmd/func.c @ 846:bc982f1ad106
Merged DMD 1.037 frontend
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Sat, 13 Dec 2008 13:15:31 +0100 |
parents | a26b0c5d5942 |
children | 330f999ade44 |
comparison
equal
deleted
inserted
replaced
845:d128381e086e | 846:bc982f1ad106 |
---|---|
1963 return isMember() && | 1963 return isMember() && |
1964 !(isStatic() || protection == PROTprivate || protection == PROTpackage) && | 1964 !(isStatic() || protection == PROTprivate || protection == PROTpackage) && |
1965 toParent()->isClassDeclaration(); | 1965 toParent()->isClassDeclaration(); |
1966 } | 1966 } |
1967 | 1967 |
1968 int FuncDeclaration::isFinal() | |
1969 { | |
1970 ClassDeclaration *cd; | |
1971 #if 0 | |
1972 printf("FuncDeclaration::isFinal(%s)\n", toChars()); | |
1973 printf("%p %d %d %d %d\n", isMember(), isStatic(), protection == PROTprivate, isCtorDeclaration(), linkage != LINKd); | |
1974 printf("result is %d\n", | |
1975 isMember() && | |
1976 !(isStatic() || protection == PROTprivate || protection == PROTpackage) && | |
1977 (cd = toParent()->isClassDeclaration()) != NULL && | |
1978 cd->storage_class & STCfinal); | |
1979 #endif | |
1980 return isMember() && | |
1981 (Declaration::isFinal() || | |
1982 ((cd = toParent()->isClassDeclaration()) != NULL && cd->storage_class & STCfinal)); | |
1983 } | |
1984 | |
1968 int FuncDeclaration::isAbstract() | 1985 int FuncDeclaration::isAbstract() |
1969 { | 1986 { |
1970 return storage_class & STCabstract; | 1987 return storage_class & STCabstract; |
1971 } | 1988 } |
1972 | 1989 |
2706 | 2723 |
2707 void UnitTestDeclaration::semantic(Scope *sc) | 2724 void UnitTestDeclaration::semantic(Scope *sc) |
2708 { | 2725 { |
2709 if (global.params.useUnitTests) | 2726 if (global.params.useUnitTests) |
2710 { | 2727 { |
2711 Type *tret; | |
2712 | |
2713 type = new TypeFunction(NULL, Type::tvoid, FALSE, LINKd); | 2728 type = new TypeFunction(NULL, Type::tvoid, FALSE, LINKd); |
2714 FuncDeclaration::semantic(sc); | 2729 Scope *sc2 = sc->push(); |
2730 sc2->linkage = LINKd; | |
2731 FuncDeclaration::semantic(sc2); | |
2732 sc2->pop(); | |
2715 } | 2733 } |
2716 | 2734 |
2717 // We're going to need ModuleInfo even if the unit tests are not | 2735 // We're going to need ModuleInfo even if the unit tests are not |
2718 // compiled in, because other modules may import this module and refer | 2736 // compiled in, because other modules may import this module and refer |
2719 // to this ModuleInfo. | 2737 // to this ModuleInfo. |