Mercurial > projects > ldc
comparison dmd/func.c @ 333:f7190d9eb70c trunk
[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.
author | ChristianK |
---|---|
date | Sat, 12 Jul 2008 09:23:14 +0200 |
parents | 2b72433d5c8c |
children | aaade6ded589 |
comparison
equal
deleted
inserted
replaced
332:d7e6ace5cca4 | 333:f7190d9eb70c |
---|---|
2206 Dsymbol *parent = toParent(); | 2206 Dsymbol *parent = toParent(); |
2207 cd = parent->isClassDeclaration(); | 2207 cd = parent->isClassDeclaration(); |
2208 if (!cd) | 2208 if (!cd) |
2209 { | 2209 { |
2210 error("constructors are only for class definitions"); | 2210 error("constructors are only for class definitions"); |
2211 fatal(); | |
2211 tret = Type::tvoid; | 2212 tret = Type::tvoid; |
2212 } | 2213 } |
2213 else | 2214 else |
2214 tret = cd->type; //->referenceTo(); | 2215 tret = cd->type; //->referenceTo(); |
2215 type = new TypeFunction(arguments, tret, varargs, LINKd); | 2216 type = new TypeFunction(arguments, tret, varargs, LINKd); |
2300 Dsymbol *parent = toParent(); | 2301 Dsymbol *parent = toParent(); |
2301 cd = parent->isClassDeclaration(); | 2302 cd = parent->isClassDeclaration(); |
2302 if (!cd) | 2303 if (!cd) |
2303 { | 2304 { |
2304 error("destructors only are for class definitions"); | 2305 error("destructors only are for class definitions"); |
2306 fatal(); | |
2305 } | 2307 } |
2306 else | 2308 else |
2307 cd->dtors.push(this); | 2309 cd->dtors.push(this); |
2308 type = new TypeFunction(NULL, Type::tvoid, FALSE, LINKd); | 2310 type = new TypeFunction(NULL, Type::tvoid, FALSE, LINKd); |
2309 | 2311 |