From f0d8b9e1532b2cca77f5bd317a450fa91ee43155 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Sat, 12 Jul 2008 09:23:14 +0200 Subject: [PATCH] [svn r354] Fix the regressions between [346] and [353] by making constructors and destructors outside classes fatal errors. Fix tests makefile and add minimize to gc.d. --- dmd/func.c | 2 ++ tests/testincludes/Makefile | 2 +- tests/testincludes/std/gc.d | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dmd/func.c b/dmd/func.c index c098c439..30197b57 100644 --- a/dmd/func.c +++ b/dmd/func.c @@ -2208,6 +2208,7 @@ void CtorDeclaration::semantic(Scope *sc) if (!cd) { error("constructors are only for class definitions"); + fatal(); tret = Type::tvoid; } else @@ -2302,6 +2303,7 @@ void DtorDeclaration::semantic(Scope *sc) if (!cd) { error("destructors only are for class definitions"); + fatal(); } else cd->dtors.push(this); diff --git a/tests/testincludes/Makefile b/tests/testincludes/Makefile index 3416ca9c..5aec1e56 100644 --- a/tests/testincludes/Makefile +++ b/tests/testincludes/Makefile @@ -70,7 +70,7 @@ ALL_OBJS= \ tangobos.lib : $(LIB_TARGET) $(LIB_TARGET) : $(ALL_OBJS) - $(RM) $@ + $(RM) $(LIB_MASK) $(LLVMLINK) -o=$(LIB_TARGET).bc `find -name "*.bc"` $(LLC) -o=$(LIB_TARGET).s $(LIB_TARGET).bc $(CC) -c -o $(LIB_TARGET) $(LIB_TARGET).s diff --git a/tests/testincludes/std/gc.d b/tests/testincludes/std/gc.d index 16930423..fe690c43 100644 --- a/tests/testincludes/std/gc.d +++ b/tests/testincludes/std/gc.d @@ -194,7 +194,10 @@ void genCollect() /** * Minimizes physical memory usage */ -//void minimize(); +void minimize() +{ + GC.collect(); +} /*************************************** * disable() temporarily disables garbage collection cycle, enable()